]> source.dussan.org Git - gitea.git/commitdiff
Don't disclose emails of all users when sending out emails (#4784)
authortechknowlogick <techknowlogick@users.noreply.github.com>
Fri, 24 Aug 2018 18:37:30 +0000 (14:37 -0400)
committerGitHub <noreply@github.com>
Fri, 24 Aug 2018 18:37:30 +0000 (14:37 -0400)
Backport (#4664)

models/issue_mail.go

index 179bb6527b5498410af9f9552ea8e04c960c4200..b78da6d79a5bd7b378c289c47fdae6fdd6ac8e67 100644 (file)
@@ -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
 }