summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/journal.rb8
-rw-r--r--app/models/mailer.rb2
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/journal.rb b/app/models/journal.rb
index 895b8537d..560ccf3b8 100644
--- a/app/models/journal.rb
+++ b/app/models/journal.rb
@@ -100,6 +100,14 @@ class Journal < ActiveRecord::Base
notified.map(&:mail)
end
+ def watcher_recipients
+ notified = journalized.notified_watchers
+ if private_notes?
+ notified = notified.select {|user| user.allowed_to?(:view_private_notes, journalized.project)}
+ end
+ notified.map(&:mail)
+ end
+
private
def split_private_notes
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 91b58dda2..9c19438a7 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -64,7 +64,7 @@ class Mailer < ActionMailer::Base
@author = journal.user
recipients = journal.recipients
# Watchers in cc
- cc = issue.watcher_recipients - recipients
+ cc = journal.watcher_recipients - recipients
s = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] "
s << "(#{issue.status.name}) " if journal.new_value_for('status_id')
s << issue.subject