Skip to content

Commit

Permalink
Add missing two sync feed for refs/pull (go-gitea#32815)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 13, 2024
1 parent e7de2fc commit db06923
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions services/feed/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ func (a *actionNotifier) SyncPushCommits(ctx context.Context, pusher *user_model
}

func (a *actionNotifier) SyncCreateRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName, refID string) {
// ignore pull sync message for pull requests refs
// TODO: it's better to have a UI to let users chose
if refFullName.IsPull() {
return
}

if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{
ActUserID: repo.OwnerID,
ActUser: repo.MustOwner(ctx),
Expand All @@ -431,6 +437,12 @@ func (a *actionNotifier) SyncCreateRef(ctx context.Context, doer *user_model.Use
}

func (a *actionNotifier) SyncDeleteRef(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, refFullName git.RefName) {
// ignore pull sync message for pull requests refs
// TODO: it's better to have a UI to let users chose
if refFullName.IsPull() {
return
}

if err := activities_model.NotifyWatchers(ctx, &activities_model.Action{
ActUserID: repo.OwnerID,
ActUser: repo.MustOwner(ctx),
Expand Down

0 comments on commit db06923

Please sign in to comment.