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:
authorRichard Macklin <richard.github@nrm.com>2017-01-27 12:31:57 +0300
committerRichard Macklin <richard.github@nrm.com>2017-02-01 22:31:22 +0300
commit3e81bc7b1daec9dfda602165d7e36cf5b6a39e20 (patch)
treea38aee4606338a0f6db4defd064ee3cc5c1486fc /app/services/notification_service.rb
parent0a0207ea91fdbe869ac70c23178b876bcbeb3021 (diff)
Update NotificationService to respect User#notified_of_own_activity
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb6
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