summaryrefslogtreecommitdiff
path: root/app/services/notification_service.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-15 15:56:21 +0200
committerDouwe Maan <douwe@gitlab.com>2015-04-15 17:57:31 +0200
commit959ebbcade63423048320daaa814634c41842a36 (patch)
treefb2f8392d60cdabe6ed9b0ad47a43909b3866762 /app/services/notification_service.rb
parentb73ffbd3cb7dd89f54351b74e0cf4d1df63f0310 (diff)
downloadgitlab-ce-959ebbcade63423048320daaa814634c41842a36.tar.gz
Clean up code around commit mentions.
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb11
1 files changed, 3 insertions, 8 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index cfed7964c37..1337dca8354 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -127,17 +127,12 @@ class NotificationService
recipients = []
- if note.commit_id.present?
- recipients << note.commit_author
- end
-
# Add all users participating in the thread (author, assignee, comment authors)
participants =
- if target.respond_to?(:participants)
+ if target.is_a?(Commit)
+ target.participants(note.project)
+ elsif target.respond_to?(:participants)
target.participants
- elsif target.is_a?(Commit)
- author_ids = Note.for_commit_id(target.id).pluck(:author_id).uniq
- User.where(id: author_ids)
else
note.mentioned_users
end