summaryrefslogtreecommitdiffstats
path: root/modules/notification
diff options
context:
space:
mode:
authorTyrone Yeh <siryeh@gmail.com>2022-07-28 16:30:12 +0800
committerGitHub <noreply@github.com>2022-07-28 16:30:12 +0800
commit3bd8f50af819b8dfc86b9fecdfc36ca7774c6a2d (patch)
treeffa9a1e950cb96602e7057d73e9b2dc795357ac9 /modules/notification
parent86e5268c396bd89716b2617a4949837982c1b0c3 (diff)
downloadgitea-3bd8f50af819b8dfc86b9fecdfc36ca7774c6a2d.tar.gz
gitea-3bd8f50af819b8dfc86b9fecdfc36ca7774c6a2d.zip
Added email notification option to receive all own messages (#20179)
Sometimes users want to receive email notifications of messages they create or reply to, Added an option to personal preferences to allow users to choose Closes #20149
Diffstat (limited to 'modules/notification')
-rw-r--r--modules/notification/mail/mail.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go
index 1f217304b0..5085656c14 100644
--- a/modules/notification/mail/mail.go
+++ b/modules/notification/mail/mail.go
@@ -126,7 +126,7 @@ func (m *mailNotifier) NotifyPullRequestCodeComment(pr *issues_model.PullRequest
func (m *mailNotifier) NotifyIssueChangeAssignee(doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment) {
// mail only sent to added assignees and not self-assignee
- if !removed && doer.ID != assignee.ID && (assignee.EmailNotifications() == user_model.EmailNotificationsEnabled || assignee.EmailNotifications() == user_model.EmailNotificationsOnMention) {
+ if !removed && doer.ID != assignee.ID && assignee.EmailNotifications() != user_model.EmailNotificationsDisabled {
ct := fmt.Sprintf("Assigned #%d.", issue.Index)
if err := mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*user_model.User{assignee}); err != nil {
log.Error("Error in SendIssueAssignedMail for issue[%d] to assignee[%d]: %v", issue.ID, assignee.ID, err)
@@ -135,7 +135,7 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *user_model.User, issue *i
}
func (m *mailNotifier) NotifyPullReviewRequest(doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
- if isRequest && doer.ID != reviewer.ID && (reviewer.EmailNotifications() == user_model.EmailNotificationsEnabled || reviewer.EmailNotifications() == user_model.EmailNotificationsOnMention) {
+ if isRequest && doer.ID != reviewer.ID && reviewer.EmailNotifications() != user_model.EmailNotificationsDisabled {
ct := fmt.Sprintf("Requested to review %s.", issue.HTMLURL())
if err := mailer.SendIssueAssignedMail(issue, doer, ct, comment, []*user_model.User{reviewer}); err != nil {
log.Error("Error in SendIssueAssignedMail for issue[%d] to reviewer[%d]: %v", issue.ID, reviewer.ID, err)