Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-07-20 22:02:12 +0300
committerhttp://jneen.net/ <jneen@jneen.net>2017-08-03 19:06:15 +0300
commitcce1bc9a2f3bbba5ad2a256c96d85eb2276e6ac6 (patch)
tree762bffda68271667d9a721c90d333c92bb204689 /app/services/notification_recipient_service.rb
parent9cd46811d3dd2e6a0cb1b68ba390f9ab3fc587b7 (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.rb20
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