summaryrefslogtreecommitdiffstats
path: root/modules/notification/notification.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/notification/notification.go')
-rw-r--r--modules/notification/notification.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/notification/notification.go b/modules/notification/notification.go
index 06220ecb04..0f1b63cf67 100644
--- a/modules/notification/notification.go
+++ b/modules/notification/notification.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/modules/notification/mail"
"code.gitea.io/gitea/modules/notification/ui"
"code.gitea.io/gitea/modules/notification/webhook"
+ "code.gitea.io/gitea/modules/setting"
)
var (
@@ -24,9 +25,12 @@ func RegisterNotifier(notifier base.Notifier) {
notifiers = append(notifiers, notifier)
}
-func init() {
+// NewContext registers notification handlers
+func NewContext() {
RegisterNotifier(ui.NewNotifier())
- RegisterNotifier(mail.NewNotifier())
+ if setting.Service.EnableNotifyMail {
+ RegisterNotifier(mail.NewNotifier())
+ }
RegisterNotifier(indexer.NewNotifier())
RegisterNotifier(webhook.NewNotifier())
}
@@ -138,9 +142,9 @@ func NotifyIssueChangeContent(doer *models.User, issue *models.Issue, oldContent
}
// NotifyIssueChangeAssignee notifies change content to notifiers
-func NotifyIssueChangeAssignee(doer *models.User, issue *models.Issue, removed bool) {
+func NotifyIssueChangeAssignee(doer *models.User, issue *models.Issue, assignee *models.User, removed bool, comment *models.Comment) {
for _, notifier := range notifiers {
- notifier.NotifyIssueChangeAssignee(doer, issue, removed)
+ notifier.NotifyIssueChangeAssignee(doer, issue, assignee, removed, comment)
}
}