From bf853db450c103d082be43c70c5eb4bdf674eb3f Mon Sep 17 00:00:00 2001 From: a1012112796 <1012112796@qq.com> Date: Mon, 11 Jan 2021 08:46:19 +0800 Subject: [PATCH] fix mailIssueCommentBatch for pull request (#14252) (#14296) fix #14250 Signed-off-by: a1012112796 <1012112796@qq.com> --- services/mailer/mail_issue.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/mailer/mail_issue.go b/services/mailer/mail_issue.go index ffe2a4e471..b600060a67 100644 --- a/services/mailer/mail_issue.go +++ b/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++ }