Issue content should not be updated when closing with comment (#2833)

This commit is contained in:
Lauris BH 2017-11-03 11:23:17 +02:00 committed by Lunny Xiao
parent 8798cf4e3b
commit 240609432b
5 changed files with 78 additions and 25 deletions

View file

@ -272,15 +272,15 @@ func (c *Comment) MailParticipants(e Engine, opType ActionType, issue *Issue) (e
return fmt.Errorf("UpdateIssueMentions [%d]: %v", c.IssueID, err)
}
content := c.Content
switch opType {
case ActionCommentIssue:
issue.Content = c.Content
case ActionCloseIssue:
issue.Content = fmt.Sprintf("Closed #%d", issue.Index)
content = fmt.Sprintf("Closed #%d", issue.Index)
case ActionReopenIssue:
issue.Content = fmt.Sprintf("Reopened #%d", issue.Index)
content = fmt.Sprintf("Reopened #%d", issue.Index)
}
if err = mailIssueCommentToParticipants(e, issue, c.Poster, c, mentions); err != nil {
if err = mailIssueCommentToParticipants(e, issue, c.Poster, content, c, mentions); err != nil {
log.Error(4, "mailIssueCommentToParticipants: %v", err)
}