diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-01-13 22:42:55 +0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2019-01-13 16:42:55 +0200 |
commit | beab2df1227f9b7e556aa5716d94feb3a3e2088e (patch) | |
tree | ef72c59cc4e3ab7ccaa29ffc5de4d3a4278e348e /models/issue_comment.go | |
parent | e5228b8369f7162026b6fa6c1a8a0f07b92d85c7 (diff) | |
download | gitea-beab2df1227f9b7e556aa5716d94feb3a3e2088e.tar.gz gitea-beab2df1227f9b7e556aa5716d94feb3a3e2088e.zip |
Refactor mail notification (#5110)
* mail notification implement interface
* fix file comment year
* use NullNotifier as parent struct of notifiers
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r-- | models/issue_comment.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go index 651cbdfad1..03096414ee 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -361,7 +361,11 @@ func (c *Comment) LoadDepIssueDetails() (err error) { // MailParticipants sends new comment emails to repository watchers // and mentioned people. -func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (err error) { +func (c *Comment) MailParticipants(opType ActionType, issue *Issue) (err error) { + return c.mailParticipants(x, opType, issue) +} + +func (c *Comment) mailParticipants(e Engine, opType ActionType, issue *Issue) (err error) { mentions := markup.FindAllMentions(c.Content) if err = UpdateIssueMentions(e, c.IssueID, mentions); err != nil { return fmt.Errorf("UpdateIssueMentions [%d]: %v", c.IssueID, err) @@ -632,9 +636,6 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen if err = notifyWatchers(e, act); err != nil { log.Error(4, "notifyWatchers: %v", err) } - if err = comment.MailParticipants(e, act.OpType, opts.Issue); err != nil { - log.Error(4, "MailParticipants: %v", err) - } } return nil } |