summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-22 01:08:42 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-21 12:08:42 -0500
commitd7ac9727bb5046118915cbb26b2dac1b7b27c9d4 (patch)
treec3a2209dcc3482506045706d426d95b3c83454fb /services
parentd5261b9aab83138e31cbe02b1da9adc658ed400f (diff)
downloadgitea-d7ac9727bb5046118915cbb26b2dac1b7b27c9d4.tar.gz
gitea-d7ac9727bb5046118915cbb26b2dac1b7b27c9d4.zip
Move merge actions to notification (#9024)
* Move merge actions to notification * Add missing mail notification
Diffstat (limited to 'services')
-rw-r--r--services/pull/merge.go20
1 files changed, 1 insertions, 19 deletions
diff --git a/services/pull/merge.go b/services/pull/merge.go
index 8ae5f029e8..e5563a89b9 100644
--- a/services/pull/merge.go
+++ b/services/pull/merge.go
@@ -426,29 +426,11 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
log.Error("setMerged [%d]: %v", pr.ID, err)
}
- if err := models.NotifyWatchers(&models.Action{
- ActUserID: doer.ID,
- ActUser: doer,
- OpType: models.ActionMergePullRequest,
- Content: fmt.Sprintf("%d|%s", pr.Issue.Index, pr.Issue.Title),
- RepoID: pr.Issue.Repo.ID,
- Repo: pr.Issue.Repo,
- IsPrivate: pr.Issue.Repo.IsPrivate,
- }); err != nil {
- log.Error("NotifyWatchers [%d]: %v", pr.ID, err)
- }
+ notification.NotifyMergePullRequest(pr, doer, baseGitRepo)
// Reset cached commit count
cache.Remove(pr.Issue.Repo.GetCommitsCountCacheKey(pr.BaseBranch, true))
- // Reload pull request information.
- if err = pr.LoadAttributes(); err != nil {
- log.Error("LoadAttributes: %v", err)
- return nil
- }
-
- notification.NotifyIssueChangeStatus(doer, pr.Issue, true)
-
// Resolve cross references
refs, err := pr.ResolveCrossReferences()
if err != nil {