diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/issue.go | 3 | ||||
-rw-r--r-- | models/issue_comment.go | 9 | ||||
-rw-r--r-- | models/pull.go | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/models/issue.go b/models/issue.go index c982931c0f..f81281b0e1 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1121,9 +1121,6 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, assigneeIDs []in }); err != nil { log.Error(4, "NotifyWatchers: %v", err) } - if err = issue.MailParticipants(); err != nil { - log.Error(4, "MailParticipants: %v", err) - } mode, _ := AccessLevel(issue.Poster, issue.Repo) if err = PrepareWebhooks(repo, HookEventIssues, &api.IssuePayload{ 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 } diff --git a/models/pull.go b/models/pull.go index cd21e494a2..d7e11de032 100644 --- a/models/pull.go +++ b/models/pull.go @@ -845,8 +845,6 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str IsPrivate: repo.IsPrivate, }); err != nil { log.Error(4, "NotifyWatchers: %v", err) - } else if err = pull.MailParticipants(); err != nil { - log.Error(4, "MailParticipants: %v", err) } pr.Issue = pull |