From b35b8e7898a28b82c636ec01ce4f5a69ce7a7588 Mon Sep 17 00:00:00 2001 From: Matti Ranta Date: Fri, 10 Aug 2018 18:13:18 -0400 Subject: [PATCH 1/2] don't disclose emails of all users when sending out emails Fix #4417 --- models/issue_mail.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/models/issue_mail.go b/models/issue_mail.go index 179bb6527b549..61f52403c4b57 100644 --- a/models/issue_mail.go +++ b/models/issue_mail.go @@ -87,7 +87,9 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content names = append(names, participants[i].Name) } - SendIssueCommentMail(issue, doer, content, comment, tos) + for _, to := range tos { + SendIssueCommentMail(issue, doer, content, comment, []string{to}) + } // Mail mentioned people and exclude watchers. names = append(names, doer.Name) @@ -99,7 +101,12 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content tos = append(tos, mentions[i]) } - SendIssueMentionMail(issue, doer, content, comment, getUserEmailsByNames(e, tos)) + + emails := getUserEmailsByNames(e, tos) + + for _, to := range emails { + SendIssueMentionMail(issue, doer, content, comment, []string{to}) + } return nil } From eee9e985009e3aa09cfe36d82caeccea1a9fb2a8 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Fri, 10 Aug 2018 18:18:13 -0400 Subject: [PATCH 2/2] add copyright --- models/issue_mail.go | 1 + 1 file changed, 1 insertion(+) diff --git a/models/issue_mail.go b/models/issue_mail.go index 61f52403c4b57..b78da6d79a5bd 100644 --- a/models/issue_mail.go +++ b/models/issue_mail.go @@ -1,4 +1,5 @@ // Copyright 2016 The Gogs Authors. All rights reserved. +// Copyright 2018 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file.