diff options
author | Jakub Zienkiewicz <jakub@zienkiewi.cz> | 2013-09-13 15:38:37 +0200 |
---|---|---|
committer | Jakub Zienkiewicz <jakub@zienkiewi.cz> | 2013-09-13 15:38:37 +0200 |
commit | 49f609a9366db616f6695f9e34ecfdfbcadafa2c (patch) | |
tree | 45a1548c489a8d3aa6d3601f72b261f6ed8ebd2f /app/services | |
parent | 996d146cbd6987d54bc720550b96aacd90c2982a (diff) | |
download | gitlab-ce-49f609a9366db616f6695f9e34ecfdfbcadafa2c.tar.gz |
notify commit author of new notes
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/notification_service.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 71c25dc1b70..750a71aea6b 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -107,12 +107,6 @@ class NotificationService opts = { noteable_type: note.noteable_type, project_id: note.project_id } - if note.commit_id.present? - opts.merge!(commit_id: note.commit_id) - else - opts.merge!(noteable_id: note.noteable_id) - end - target = note.noteable if target.respond_to?(:participants) recipients = target.participants @@ -120,6 +114,13 @@ class NotificationService recipients = note.mentioned_users end + if note.commit_id.present? + opts.merge!(commit_id: note.commit_id) + recipients << note.commit_author + else + opts.merge!(noteable_id: note.noteable_id) + end + # Get users who left comment in thread recipients = recipients.concat(User.where(id: Note.where(opts).pluck(:author_id))) |