Commit cce1bc9a authored by http://jneen.net/'s avatar http://jneen.net/

use notification_setting_for_user_project in reject_users

parent 9cd46811
...@@ -267,24 +267,8 @@ class NotificationRecipientService ...@@ -267,24 +267,8 @@ class NotificationRecipientService
users = users.to_a.compact.uniq users = users.to_a.compact.uniq
users.reject do |user| users.reject do |user|
global_notification_setting = user.global_notification_setting setting = NotificationRecipientService.notification_setting_for_user_project(user, project)
setting.present? && setting.level == level
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
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment