]> source.dussan.org Git - gitea.git/commitdiff
fix mailIssueCommentBatch for pull request (#14252)
authora1012112796 <1012112796@qq.com>
Sat, 9 Jan 2021 17:34:08 +0000 (01:34 +0800)
committerGitHub <noreply@github.com>
Sat, 9 Jan 2021 17:34:08 +0000 (17:34 +0000)
fix #14250

Signed-off-by: a1012112796 <1012112796@qq.com>
services/mailer/mail_issue.go

index ffe2a4e4718dfb19f84122071405948ac046068e..b600060a67f5e82c7436531026df090d788dccbc 100644 (file)
@@ -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++
                        }