summaryrefslogtreecommitdiffstats
path: root/services/mailer/mail_issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/mailer/mail_issue.go')
-rw-r--r--services/mailer/mail_issue.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/services/mailer/mail_issue.go b/services/mailer/mail_issue.go
index 92d2c5a879..da0249d595 100644
--- a/services/mailer/mail_issue.go
+++ b/services/mailer/mail_issue.go
@@ -123,11 +123,18 @@ func MailParticipants(issue *models.Issue, doer *models.User, opType models.Acti
}
func mailParticipants(ctx models.DBContext, issue *models.Issue, doer *models.User, opType models.ActionType) (err error) {
- mentions := markup.FindAllMentions(issue.Content)
-
- if err = models.UpdateIssueMentions(ctx, issue.ID, mentions); err != nil {
+ rawMentions := markup.FindAllMentions(issue.Content)
+ userMentions, err := issue.ResolveMentionsByVisibility(ctx, doer, rawMentions)
+ if err != nil {
+ return fmt.Errorf("ResolveMentionsByVisibility [%d]: %v", issue.ID, err)
+ }
+ if err = models.UpdateIssueMentions(ctx, issue.ID, userMentions); err != nil {
return fmt.Errorf("UpdateIssueMentions [%d]: %v", issue.ID, err)
}
+ mentions := make([]string, len(userMentions))
+ for i, u := range userMentions {
+ mentions[i] = u.LowerName
+ }
if len(issue.Content) > 0 {
if err = mailIssueCommentToParticipants(issue, doer, issue.Content, nil, mentions); err != nil {