fix mailIssueCommentBatch for pull request (#14252) (#14296)

fix #14250

Signed-off-by: a1012112796 <1012112796@qq.com>
pull/14337/head
a1012112796 4 years ago committed by GitHub
parent fb656b5124
commit bf853db450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      services/mailer/mail_issue.go

@ -123,10 +123,14 @@ func mailIssueCommentBatch(ctx *mailCommentContext, ids []int64, visited map[int
return err
}
checkUnit := models.UnitTypeIssues
if ctx.Issue.IsPull {
checkUnit = models.UnitTypePullRequests
}
// Make sure all recipients can still see the issue
idx := 0
for _, r := range recipients {
if ctx.Issue.Repo.CheckUnitUser(r, models.UnitTypeIssues) {
if ctx.Issue.Repo.CheckUnitUser(r, checkUnit) {
recipients[idx] = r
idx++
}

Loading…
Cancel
Save