Skip to content

Commit

Permalink
Don't disclose emails of all users when sending out emails (#4664)
Browse files Browse the repository at this point in the history
  • Loading branch information
techknowlogick committed Aug 24, 2018
1 parent 912953e commit 194a11e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions models/issue_mail.go
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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)
Expand All @@ -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
}
Expand Down

0 comments on commit 194a11e

Please sign in to comment.