mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Don't manipulate input params in email notification (#16011)
This commit is contained in:
parent
d8c99c64d5
commit
d79c8bc302
3 changed files with 12 additions and 6 deletions
|
@ -161,12 +161,18 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*models.User, visite
|
|||
// 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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue