summaryrefslogtreecommitdiff
path: root/app/services/notification_service.rb
diff options
context:
space:
mode:
authorJavier Castro <javiercastro@nexion.com.ar>2013-05-09 20:37:47 -0300
committerJavier Castro <javiercastro@nexion.com.ar>2013-06-24 11:55:44 -0300
commitcf35d19c2ef6afd04b7339e5425f2f4a015e6acf (patch)
tree43c794093165a85a726b177207337db980a5af5a /app/services/notification_service.rb
parenta324960d92d4c2436064329137857686d90100b5 (diff)
downloadgitlab-ce-cf35d19c2ef6afd04b7339e5425f2f4a015e6acf.tar.gz
Show participants on issues, including mentions, and notify email to all participants
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r--app/services/notification_service.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb
index 379d2c54629..b0243481b35 100644
--- a/app/services/notification_service.rb
+++ b/app/services/notification_service.rb
@@ -110,9 +110,11 @@ class NotificationService
else
opts.merge!(noteable_id: note.noteable_id)
target = note.noteable
- recipients = []
- recipients << target.assignee if target.respond_to?(:assignee)
- recipients << target.author if target.respond_to?(:author)
+ if target.respond_to?(:participants)
+ recipients = target.participants
+ else
+ recipients = []
+ end
end
# Get users who left comment in thread
@@ -181,7 +183,12 @@ class NotificationService
end
def new_resource_email(target, method)
- recipients = reject_muted_users([target.assignee], target.project)
+ if target.respond_to?(:participants)
+ recipients = target.participants
+ else
+ recipients = []
+ end
+ recipients = reject_muted_users(recipients, target.project)
recipients = recipients.concat(project_watchers(target.project)).uniq
recipients.delete(target.author)