Skip to content

Commit 194a11e

Browse files
Don't disclose emails of all users when sending out emails (#4664)
1 parent 912953e commit 194a11e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

models/issue_mail.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Copyright 2016 The Gogs Authors. All rights reserved.
2+
// Copyright 2018 The Gitea Authors. All rights reserved.
23
// Use of this source code is governed by a MIT-style
34
// license that can be found in the LICENSE file.
45

@@ -87,7 +88,9 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content
8788
names = append(names, participants[i].Name)
8889
}
8990

90-
SendIssueCommentMail(issue, doer, content, comment, tos)
91+
for _, to := range tos {
92+
SendIssueCommentMail(issue, doer, content, comment, []string{to})
93+
}
9194

9295
// Mail mentioned people and exclude watchers.
9396
names = append(names, doer.Name)
@@ -99,7 +102,12 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content
99102

100103
tos = append(tos, mentions[i])
101104
}
102-
SendIssueMentionMail(issue, doer, content, comment, getUserEmailsByNames(e, tos))
105+
106+
emails := getUserEmailsByNames(e, tos)
107+
108+
for _, to := range emails {
109+
SendIssueMentionMail(issue, doer, content, comment, []string{to})
110+
}
103111

104112
return nil
105113
}

0 commit comments

Comments
 (0)