diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-07-20 22:02:12 +0300 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-08-03 19:06:15 +0300 |
commit | cce1bc9a2f3bbba5ad2a256c96d85eb2276e6ac6 (patch) | |
tree | 762bffda68271667d9a721c90d333c92bb204689 /app/services/notification_recipient_service.rb | |
parent | 9cd46811d3dd2e6a0cb1b68ba390f9ab3fc587b7 (diff) |
use notification_setting_for_user_project in reject_users
Diffstat (limited to 'app/services/notification_recipient_service.rb')
-rw-r--r-- | app/services/notification_recipient_service.rb | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/app/services/notification_recipient_service.rb b/app/services/notification_recipient_service.rb index e1456158ff7..92049add32d 100644 --- a/app/services/notification_recipient_service.rb +++ b/app/services/notification_recipient_service.rb @@ -267,24 +267,8 @@ class NotificationRecipientService users = users.to_a.compact.uniq users.reject do |user| - global_notification_setting = user.global_notification_setting - - next global_notification_setting.level == level unless project - - setting = user.notification_settings_for(project) - - if project.group && (setting.nil? || setting.global?) - setting = user.notification_settings_for(project.group) - end - - # reject users who globally set mention notification and has no setting per project/group - next global_notification_setting.level == level unless setting - - # reject users who set mention notification in project - next true if setting.level == level - - # reject users who have mention level in project and disabled in global settings - setting.global? && global_notification_setting.level == level + setting = NotificationRecipientService.notification_setting_for_user_project(user, project) + setting.present? && setting.level == level end end |