inslude author & assignee to note notification recipients

This commit is contained in:
Dmitriy Zaporozhets 2013-03-28 14:51:25 +02:00
parent 618249734b
commit 70947fedda
2 changed files with 60 additions and 27 deletions

View file

@ -106,12 +106,14 @@ class NotificationService
if note.commit_id
opts.merge!(commit_id: note.commit_id)
recipients = [note.commit_author]
else
opts.merge!(noteable_id: note.noteable_id)
recipients = [note.noteable.try(:author), note.noteable.try(:assignee)]
end
# Get users who left comment in thread
recipients = User.where(id: Note.where(opts).pluck(:author_id))
recipients = recipients.concat(User.where(id: Note.where(opts).pluck(:author_id)))
# Merge project watchers
recipients = recipients.concat(project_watchers(note.project)).compact.uniq