diff options
author | Stan Hu <stanhu@gmail.com> | 2017-03-16 20:18:57 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-03-16 20:18:57 -0700 |
commit | 7cad597f6c8ba794c6852e23d718ed7827da35c6 (patch) | |
tree | a81a2f320f35a546b5a6d7a1b54015877d53c0ff /app/services/notification_service.rb | |
parent | 4bf4612cfbe73845391375bf721592426d7b4181 (diff) | |
download | gitlab-ce-7cad597f6c8ba794c6852e23d718ed7827da35c6.tar.gz |
Revert "Merge branch '8836-mr-revert' into 'master'
This reverts commit 68e40bd49fde7b790bb31b9ac85a249bedd817d2, reversing
changes made to 2d1f823b4c8b60cee525384cb52e547d2be8925a.
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index fdaba9b95fb..d12692ecc90 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 @@ -327,8 +327,9 @@ class NotificationService recipients ||= build_recipients( pipeline, pipeline.project, - nil, # The acting user, who won't be added to recipients - action: pipeline.status).map(&:notification_email) + pipeline.user, + action: pipeline.status, + skip_current_user: false).map(&:notification_email) if recipients.any? mailer.public_send(email_template, pipeline, recipients).deliver_later @@ -627,7 +628,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.notified_of_own_activity? recipients.uniq end @@ -636,7 +637,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 |