]> source.dussan.org Git - gitea.git/commitdiff
fix mailIssueCommentBatch for pull request (#14252) (#14296)
authora1012112796 <1012112796@qq.com>
Mon, 11 Jan 2021 00:46:19 +0000 (08:46 +0800)
committerGitHub <noreply@github.com>
Mon, 11 Jan 2021 00:46:19 +0000 (08:46 +0800)
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++
                        }