summaryrefslogtreecommitdiffstats
path: root/services/mailer/mail_comment.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer/mail_comment.go')
-rw-r--r--services/mailer/mail_comment.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/mailer/mail_comment.go b/services/mailer/mail_comment.go
index 3662164092..a42458b2c2 100644
--- a/services/mailer/mail_comment.go
+++ b/services/mailer/mail_comment.go
@@ -5,6 +5,8 @@
package mailer
import (
+ "context"
+
"code.gitea.io/gitea/models"
user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/log"
@@ -12,7 +14,7 @@ import (
)
// MailParticipantsComment sends new comment emails to repository watchers and mentioned people.
-func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue *models.Issue, mentions []*user_model.User) error {
+func MailParticipantsComment(ctx context.Context, c *models.Comment, opType models.ActionType, issue *models.Issue, mentions []*user_model.User) error {
if setting.MailService == nil {
// No mail service configured
return nil
@@ -24,6 +26,7 @@ func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue
}
if err := mailIssueCommentToParticipants(
&mailCommentContext{
+ Context: ctx,
Issue: issue,
Doer: c.Poster,
ActionType: opType,
@@ -36,7 +39,7 @@ func MailParticipantsComment(c *models.Comment, opType models.ActionType, issue
}
// MailMentionsComment sends email to users mentioned in a code comment
-func MailMentionsComment(pr *models.PullRequest, c *models.Comment, mentions []*user_model.User) (err error) {
+func MailMentionsComment(ctx context.Context, pr *models.PullRequest, c *models.Comment, mentions []*user_model.User) (err error) {
if setting.MailService == nil {
// No mail service configured
return nil
@@ -46,6 +49,7 @@ func MailMentionsComment(pr *models.PullRequest, c *models.Comment, mentions []*
visited[c.Poster.ID] = true
if err = mailIssueCommentBatch(
&mailCommentContext{
+ Context: ctx,
Issue: pr.Issue,
Doer: c.Poster,
ActionType: models.ActionCommentPull,