fix mailIssueCommentBatch for pull request (#14252)

fix #14250

Signed-off-by: a1012112796 <1012112796@qq.com>
release/v1.15
a1012112796 2021-01-10 01:34:08 +08:00 committed by GitHub
parent 736928286b
commit d989247bb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

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