Skip to content

Commit

Permalink
Add missing mail notification
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Nov 21, 2019
1 parent b6d8389 commit f0519f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 12 additions & 0 deletions modules/notification/mail/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification/base"
"code.gitea.io/gitea/services/mailer"
Expand Down Expand Up @@ -98,3 +99,14 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *model
mailer.SendIssueAssignedMail(issue, doer, ct, comment, []string{assignee.Email})
}
}

func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
if err := pr.LoadIssue(); err != nil {
log.Error("pr.LoadIssue: %v", err)
return
}

if err := mailer.MailParticipants(pr.Issue, doer, models.ActionClosePullRequest); err != nil {
log.Error("MailParticipants: %v", err)
}
}
2 changes: 0 additions & 2 deletions routers/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,6 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) {
return
}

notification.NotifyMergePullRequest(pr, ctx.User, ctx.Repo.GitRepo)

log.Trace("Pull request merged: %d", pr.ID)
ctx.Redirect(ctx.Repo.RepoLink + "/pulls/" + com.ToStr(pr.Index))
}
Expand Down

0 comments on commit f0519f4

Please sign in to comment.