fix: register bots notifier when enabled only

This commit is contained in:
Jason Song 2022-11-28 18:24:09 +08:00
parent e37b3911d8
commit 6f5c3feb2d
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5

View File

@ -41,8 +41,10 @@ func NewContext() {
RegisterNotifier(webhook.NewNotifier()) RegisterNotifier(webhook.NewNotifier())
RegisterNotifier(action.NewNotifier()) RegisterNotifier(action.NewNotifier())
RegisterNotifier(mirror.NewNotifier()) RegisterNotifier(mirror.NewNotifier())
if setting.Bots.Enabled {
RegisterNotifier(bots.NewNotifier()) RegisterNotifier(bots.NewNotifier())
} }
}
// NotifyNewWikiPage notifies creating new wiki pages to notifiers // NotifyNewWikiPage notifies creating new wiki pages to notifiers
func NotifyNewWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, page, comment string) { func NotifyNewWikiPage(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, page, comment string) {