mailParticipants sends new comment emails to repository watchers and mentioned people.
(e Engine, opType ActionType, issue *Issue)
| 164 | // mailParticipants sends new comment emails to repository watchers |
| 165 | // and mentioned people. |
| 166 | func (c *Comment) mailParticipants(e Engine, opType ActionType, issue *Issue) (err error) { |
| 167 | mentions := markup.FindAllMentions(c.Content) |
| 168 | if err = updateIssueMentions(e, c.IssueID, mentions); err != nil { |
| 169 | return errors.Newf("UpdateIssueMentions [%d]: %v", c.IssueID, err) |
| 170 | } |
| 171 | |
| 172 | switch opType { |
| 173 | case ActionCommentIssue: |
| 174 | issue.Content = c.Content |
| 175 | case ActionCloseIssue: |
| 176 | issue.Content = fmt.Sprintf("Closed #%d", issue.Index) |
| 177 | case ActionReopenIssue: |
| 178 | issue.Content = fmt.Sprintf("Reopened #%d", issue.Index) |
| 179 | } |
| 180 | if err = mailIssueCommentToParticipants(issue, c.Poster, mentions); err != nil { |
| 181 | log.Error("mailIssueCommentToParticipants: %v", err) |
| 182 | } |
| 183 | |
| 184 | return nil |
| 185 | } |
| 186 | |
| 187 | func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err error) { |
| 188 | comment := &Comment{ |
no test coverage detected