diff options
author | YarNayar <YarTheGreat@gmail.com> | 2017-07-25 14:56:09 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-03-26 13:24:52 +0100 |
commit | 99b01e23598e6b0b2bcae891939ea28c67f7b2e9 (patch) | |
tree | c32d351419cd399dcb104eac54563b7028bbd1d8 /app/models/notification_recipient.rb | |
parent | bb9d360c0a7daed6aa08a0635e084c314c2c8b3e (diff) | |
download | gitlab-ce-99b01e23598e6b0b2bcae891939ea28c67f7b2e9.tar.gz |
Send notification emails when push to a merge requestYarNayar/gitlab-ce-23460-send-email-when-pushing-more-commits-to-the-merge-request
Closes #23460
Diffstat (limited to 'app/models/notification_recipient.rb')
-rw-r--r-- | app/models/notification_recipient.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/app/models/notification_recipient.rb b/app/models/notification_recipient.rb index e95655e19f8..b3ffad00a07 100644 --- a/app/models/notification_recipient.rb +++ b/app/models/notification_recipient.rb @@ -48,7 +48,7 @@ class NotificationRecipient when :custom custom_enabled? || %i[participating mention].include?(@type) when :watch, :participating - !excluded_watcher_action? + !action_excluded? when :mention @type == :mention else @@ -96,13 +96,22 @@ class NotificationRecipient end end + def action_excluded? + excluded_watcher_action? || excluded_participating_action? + end + def excluded_watcher_action? - return false unless @custom_action - return false if notification_level == :custom + return false unless @custom_action && notification_level == :watch NotificationSetting::EXCLUDED_WATCHER_EVENTS.include?(@custom_action) end + def excluded_participating_action? + return false unless @custom_action && notification_level == :participating + + NotificationSetting::EXCLUDED_PARTICIPATING_EVENTS.include?(@custom_action) + end + private def read_ability |