1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Move notification interface to services layer (#26915)

Extract from #22266
This commit is contained in:
Lunny Xiao
2023-09-06 02:37:47 +08:00
committed by GitHub
parent 084eacb5d4
commit 540bf9fa6d
51 changed files with 972 additions and 969 deletions

View File

@@ -14,8 +14,8 @@ import (
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/private"
notify_service "code.gitea.io/gitea/services/notify"
pull_service "code.gitea.io/gitea/services/pull"
)
@@ -208,9 +208,9 @@ func ProcReceive(ctx context.Context, repo *repo_model.Repository, gitRepo *git.
}
comment, err := pull_service.CreatePushPullComment(ctx, pusher, pr, oldCommitID, opts.NewCommitIDs[i])
if err == nil && comment != nil {
notification.NotifyPullRequestPushCommits(ctx, pusher, pr, comment)
notify_service.PullRequestPushCommits(ctx, pusher, pr, comment)
}
notification.NotifyPullRequestSynchronized(ctx, pusher, pr)
notify_service.PullRequestSynchronized(ctx, pusher, pr)
isForcePush := comment != nil && comment.IsForcePush
results = append(results, private.HookProcReceiveRefResult{