Commit 6610bb6b authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Moves watchers filtering logic to ActsAsWatchable.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3168 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent f3323118
......@@ -314,13 +314,6 @@ class Issue < ActiveRecord::Base
notified.collect(&:mail)
end
# Returns the mail adresses of watchers that should be notified
def watcher_recipients
notified = watcher_users
notified.reject! {|user| !user.active? || !visible?(user)}
notified.collect(&:mail)
end
# Returns the total number of hours spent on this issue.
#
# Example:
......
......@@ -53,7 +53,11 @@ module Redmine
# Returns an array of watchers' email addresses
def watcher_recipients
self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
notified = watchers.collect(&:user).select(&:active?)
if respond_to?(:visible?)
notified.reject! {|user| !visible?(user)}
end
notified.collect(&:mail).compact
end
module ClassMethods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment