Skip to content

Commit

Permalink
not send notification emails to inactive users (part 2)
Browse files Browse the repository at this point in the history
Unfortunately fixing changes to `mail_issue.go` did not get included in go-gitea#19131.

We also need to not send issue comment mails to deactivated users.

Fix go-gitea#18950

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed Mar 19, 2022
1 parent d160d8c commit 3552a76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/mailer/mail_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,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 ||
Expand Down

0 comments on commit 3552a76

Please sign in to comment.