Skip to content

Commit

Permalink
Make sure email recipients can see issue (go-gitea#13820)
Browse files Browse the repository at this point in the history
* Initial pass

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Remove over-op

Signed-off-by: jolheiser <john.olheiser@gmail.com>
  • Loading branch information
jolheiser committed Dec 3, 2020
1 parent 10fff12 commit 8b4d00d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion services/mailer/mail_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@ func mailIssueCommentBatch(ctx *mailCommentContext, ids []int64, visited map[int
if err != nil {
return err
}
// TODO: Check issue visibility for each user

// Make sure all recipients can still see the issue
idx := 0
for _, r := range recipients {
if ctx.Issue.Repo.CheckUnitUser(r, models.UnitTypeIssues) {
recipients[idx] = r
idx++
}
}
recipients = recipients[:idx]

// TODO: Separate recipients by language for i18n mail templates
tos := make([]string, len(recipients))
for i := range recipients {
Expand Down

0 comments on commit 8b4d00d

Please sign in to comment.