summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@users.noreply.github.com>2018-08-24 00:41:26 -0400
committerGitHub <noreply@github.com>2018-08-24 00:41:26 -0400
commit194a11eb110cd98fc2ba52861abf7770db6885a3 (patch)
tree30039016fba5c007564f9de4440a979def76aba9
parent912953e82a851492c7fd1f2e9c10d3a1955b625c (diff)
downloadgitea-194a11eb110cd98fc2ba52861abf7770db6885a3.tar.gz
gitea-194a11eb110cd98fc2ba52861abf7770db6885a3.zip
Don't disclose emails of all users when sending out emails (#4664)
-rw-r--r--models/issue_mail.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/models/issue_mail.go b/models/issue_mail.go
index 179bb6527b..b78da6d79a 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.
@@ -87,7 +88,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 +102,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
}