1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-29 05:38:37 +00:00

Don't manipulate input params in email notification (#16011) (#16033)

Backport #16011
This commit is contained in:
Jimmy Praet
2021-05-31 08:17:34 +02:00
committed by GitHub
parent 3a79f1190f
commit 8007602b40
3 changed files with 12 additions and 5 deletions

View File

@@ -20,12 +20,16 @@ func mailParticipantsComment(c *models.Comment, opType models.ActionType, issue
for i, u := range mentions {
mentionedIDs[i] = u.ID
}
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,
}, mentionedIDs); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)

View File

@@ -158,12 +158,18 @@ func mailParticipants(issue *models.Issue, doer *models.User, opType models.Acti
for i, u := range mentions {
mentionedIDs[i] = u.ID
}
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,
}, mentionedIDs); err != nil {
log.Error("mailIssueCommentToParticipants: %v", err)