Commit 49f609a9366db616f6695f9e34ecfdfbcadafa2c

Authored by Jakub Zienkiewicz
1 parent 996d146c

notify commit author of new notes

Showing 1 changed file with 7 additions and 6 deletions   Show diff stats
app/services/notification_service.rb
... ... @@ -107,12 +107,6 @@ class NotificationService
107 107  
108 108 opts = { noteable_type: note.noteable_type, project_id: note.project_id }
109 109  
110   - if note.commit_id.present?
111   - opts.merge!(commit_id: note.commit_id)
112   - else
113   - opts.merge!(noteable_id: note.noteable_id)
114   - end
115   -
116 110 target = note.noteable
117 111 if target.respond_to?(:participants)
118 112 recipients = target.participants
... ... @@ -120,6 +114,13 @@ class NotificationService
120 114 recipients = note.mentioned_users
121 115 end
122 116  
  117 + if note.commit_id.present?
  118 + opts.merge!(commit_id: note.commit_id)
  119 + recipients << note.commit_author
  120 + else
  121 + opts.merge!(noteable_id: note.noteable_id)
  122 + end
  123 +
123 124 # Get users who left comment in thread
124 125 recipients = recipients.concat(User.where(id: Note.where(opts).pluck(:author_id)))
125 126  
... ...