Skip to content

Commit f0cc297

Browse files
authored
Make sure email recipients can see issue (#13820)
* Initial pass Signed-off-by: jolheiser <[email protected]> * Remove over-op Signed-off-by: jolheiser <[email protected]>
1 parent 5d43d29 commit f0cc297

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

services/mailer/mail_issue.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,17 @@ func mailIssueCommentBatch(ctx *mailCommentContext, ids []int64, visited map[int
122122
if err != nil {
123123
return err
124124
}
125-
// TODO: Check issue visibility for each user
125+
126+
// Make sure all recipients can still see the issue
127+
idx := 0
128+
for _, r := range recipients {
129+
if ctx.Issue.Repo.CheckUnitUser(r, models.UnitTypeIssues) {
130+
recipients[idx] = r
131+
idx++
132+
}
133+
}
134+
recipients = recipients[:idx]
135+
126136
// TODO: Separate recipients by language for i18n mail templates
127137
tos := make([]string, len(recipients))
128138
for i := range recipients {

0 commit comments

Comments
 (0)