diff options
author | Richard Macklin <richard.github@nrm.com> | 2017-01-27 01:31:57 -0800 |
---|---|---|
committer | Richard Macklin <richard.github@nrm.com> | 2017-02-01 11:31:22 -0800 |
commit | 3e81bc7b1daec9dfda602165d7e36cf5b6a39e20 (patch) | |
tree | a38aee4606338a0f6db4defd064ee3cc5c1486fc /app/services/notification_service.rb | |
parent | 0a0207ea91fdbe869ac70c23178b876bcbeb3021 (diff) | |
download | gitlab-ce-3e81bc7b1daec9dfda602165d7e36cf5b6a39e20.tar.gz |
Update NotificationService to respect User#notified_of_own_activity
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index b2cc39763f3..5a7d5ef8747 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -217,7 +217,7 @@ class NotificationService recipients = reject_unsubscribed_users(recipients, note.noteable) recipients = reject_users_without_access(recipients, note.noteable) - recipients.delete(note.author) + recipients.delete(note.author) unless note.author.notified_of_own_activity? recipients = recipients.uniq notify_method = "note_#{note.to_ability_name}_email".to_sym @@ -627,7 +627,7 @@ class NotificationService recipients = reject_unsubscribed_users(recipients, target) recipients = reject_users_without_access(recipients, target) - recipients.delete(current_user) if skip_current_user + recipients.delete(current_user) if skip_current_user && !current_user.try(:notified_of_own_activity?) recipients.uniq end @@ -636,7 +636,7 @@ class NotificationService recipients = add_labels_subscribers([], project, target, labels: labels) recipients = reject_unsubscribed_users(recipients, target) recipients = reject_users_without_access(recipients, target) - recipients.delete(current_user) + recipients.delete(current_user) unless current_user.notified_of_own_activity? recipients.uniq end |