Skip to content

Commit 3552a76

Browse files
committed
not send notification emails to inactive users (part 2)
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]>
1 parent d160d8c commit 3552a76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

services/mailer/mail_issue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ func mailIssueCommentBatch(ctx *mailCommentContext, users []*user_model.User, vi
125125

126126
langMap := make(map[string][]*user_model.User)
127127
for _, user := range users {
128+
if !user.IsActive {
129+
// Exclude deactivated users
130+
continue
131+
}
128132
// At this point we exclude:
129133
// user that don't have all mails enabled or users only get mail on mention and this is one ...
130134
if !(user.EmailNotificationsPreference == user_model.EmailNotificationsEnabled ||

0 commit comments

Comments
 (0)