summaryrefslogtreecommitdiffstats
path: root/services/pull/pull.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-09-06 02:37:47 +0800
committerGitHub <noreply@github.com>2023-09-05 18:37:47 +0000
commit540bf9fa6d0d86297c9d575640798b718767bd9f (patch)
tree4b4a782b71e6f066af6c7807337745dc5ee6899a /services/pull/pull.go
parent084eacb5d42f1ed2520442a4bbc91bb70c9759e1 (diff)
downloadgitea-540bf9fa6d0d86297c9d575640798b718767bd9f.tar.gz
gitea-540bf9fa6d0d86297c9d575640798b718767bd9f.zip
Move notification interface to services layer (#26915)
Extract from #22266
Diffstat (limited to 'services/pull/pull.go')
-rw-r--r--services/pull/pull.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/services/pull/pull.go b/services/pull/pull.go
index d4352abafe..8e57aebe3d 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -25,12 +25,12 @@ import (
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/log"
- "code.gitea.io/gitea/modules/notification"
repo_module "code.gitea.io/gitea/modules/repository"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/sync"
"code.gitea.io/gitea/modules/util"
issue_service "code.gitea.io/gitea/services/issue"
+ notify_service "code.gitea.io/gitea/services/notify"
)
// TODO: use clustered lock (unique queue? or *abuse* cache)
@@ -145,12 +145,12 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss
return err
}
- notification.NotifyNewPullRequest(ctx, pr, mentions)
+ notify_service.NewPullRequest(ctx, pr, mentions)
if len(issue.Labels) > 0 {
- notification.NotifyIssueChangeLabels(ctx, issue.Poster, issue, issue.Labels, nil)
+ notify_service.IssueChangeLabels(ctx, issue.Poster, issue, issue.Labels, nil)
}
if issue.Milestone != nil {
- notification.NotifyIssueChangeMilestone(ctx, issue.Poster, issue, 0)
+ notify_service.IssueChangeMilestone(ctx, issue.Poster, issue, 0)
}
if len(assigneeIDs) > 0 {
for _, assigneeID := range assigneeIDs {
@@ -158,7 +158,7 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss
if err != nil {
return ErrDependenciesLeft
}
- notification.NotifyIssueChangeAssignee(ctx, issue.Poster, issue, assignee, false, assigneeCommentMap[assigneeID])
+ notify_service.IssueChangeAssignee(ctx, issue.Poster, issue, assignee, false, assigneeCommentMap[assigneeID])
}
}
@@ -315,7 +315,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
AddToTaskQueue(ctx, pr)
comment, err := CreatePushPullComment(ctx, doer, pr, oldCommitID, newCommitID)
if err == nil && comment != nil {
- notification.NotifyPullRequestPushCommits(ctx, doer, pr, comment)
+ notify_service.PullRequestPushCommits(ctx, doer, pr, comment)
}
}
@@ -365,7 +365,7 @@ func AddTestPullRequestTask(doer *user_model.User, repoID int64, branch string,
}
}
- notification.NotifyPullRequestSynchronized(ctx, doer, pr)
+ notify_service.PullRequestSynchronized(ctx, doer, pr)
}
}
}