summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-05 15:49:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-11-05 15:49:07 +0000
commitc8b722456c5d73e0a85c2073cd3fd7cd5c35a29c (patch)
tree748bf3cba8c73eca77b5ceffbe1b33f117def0e1 /lib
parent7f3cc6e38b873d5f56b411872ddcd3570223b7ad (diff)
downloadredmine-c8b722456c5d73e0a85c2073cd3fd7cd5c35a29c.tar.gz
redmine-c8b722456c5d73e0a85c2073cd3fd7cd5c35a29c.zip
Fixed that watchers receive notifications for private comments without permission (#12286).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10789 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 1f8877584..c284af38d 100644
--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -67,15 +67,18 @@ module Redmine
!!(user && self.watcher_user_ids.detect {|uid| uid == user.id })
end
- # Returns an array of watchers' email addresses
- def watcher_recipients
+ def notified_watchers
notified = watcher_users.active
- notified.reject! {|user| user.mail_notification == 'none'}
-
+ notified.reject! {|user| user.mail.blank? || user.mail_notification == 'none'}
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
end
- notified.collect(&:mail).compact
+ notified
+ end
+
+ # Returns an array of watchers' email addresses
+ def watcher_recipients
+ notified_watchers.collect(&:mail)
end
module ClassMethods; end