diff options
author | zeripath <art27@cantab.net> | 2022-03-19 16:20:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-19 16:20:03 +0000 |
commit | 3322f4d7ccc2f2f372407b246df010bc84464c15 (patch) | |
tree | 4e3a013c01fdd239d8e021d4200890f6d84c247e | |
parent | 2d21d2af9ef907ed3407b07d6a0191c39a29ee54 (diff) | |
download | gitea-3322f4d7ccc2f2f372407b246df010bc84464c15.tar.gz gitea-3322f4d7ccc2f2f372407b246df010bc84464c15.zip |
not send notification emails to inactive users (part 2) (#19142)
Unfortunately fixing changes to `mail_issue.go` did not get included in #19131.
We also need to not send issue comment mails to deactivated users.
Fix #18950
Signed-off-by: Andrew Thornton <art27@cantab.net>
-rw-r--r-- | services/mailer/mail_issue.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/mailer/mail_issue.go b/services/mailer/mail_issue.go index bd5008f076..1451150347 100644 --- a/services/mailer/mail_issue.go +++ b/services/mailer/mail_issue.go @@ -126,6 +126,10 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*user_model.User, vi langMap := make(map[string][]*user_model.User) for _, user := range users { + if !user.IsActive { + // Exclude deactivated users + continue + } // At this point we exclude: // user that don't have all mails enabled or users only get mail on mention and this is one ... if !(user.EmailNotificationsPreference == user_model.EmailNotificationsEnabled || |