func (m *mailNotifier) NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComment *models.Comment, isClosed bool) {
var actionType models.ActionType
- issue.Content = ""
if issue.IsPull {
if isClosed {
actionType = models.ActionClosePullRequest
log.Error("pr.LoadIssue: %v", err)
return
}
- pr.Issue.Content = ""
if err := mailer.MailParticipants(pr.Issue, doer, models.ActionMergePullRequest, nil); err != nil {
log.Error("MailParticipants: %v", err)
}
if err := comment.LoadPushCommits(); err != nil {
log.Error("comment.LoadPushCommits: %v", err)
}
- comment.Content = ""
-
m.NotifyCreateIssueComment(doer, comment.Issue.Repo, comment.Issue, comment, nil)
}
// MailParticipantsComment sends new comment emails to repository watchers and mentioned people.
func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue *models.Issue, mentions []*models.User) error {
+ content := c.Content
+ if c.Type == models.CommentTypePullPush {
+ content = ""
+ }
if err := mailIssueCommentToParticipants(
&mailCommentContext{
Issue: issue,
Doer: c.Poster,
ActionType: opType,
- Content: c.Content,
+ Content: content,
Comment: c,
}, mentions); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)
// MailParticipants sends new issue thread created emails to repository watchers
// and mentioned people.
func MailParticipants(issue *models.Issue, doer *models.User, opType models.ActionType, mentions []*models.User) error {
+ content := issue.Content
+ if opType == models.ActionCloseIssue || opType == models.ActionClosePullRequest ||
+ opType == models.ActionReopenIssue || opType == models.ActionReopenPullRequest ||
+ opType == models.ActionMergePullRequest {
+ content = ""
+ }
if err := mailIssueCommentToParticipants(
&mailCommentContext{
Issue: issue,
Doer: doer,
ActionType: opType,
- Content: issue.Content,
+ Content: content,
Comment: nil,
}, mentions); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)