Fixed: locked users should not receive email notifications.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1075 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
32b9bf0ef2
commit
3e031b4243
@ -190,9 +190,9 @@ class Issue < ActiveRecord::Base
|
|||||||
# Returns the mail adresses of users that should be notified for the issue
|
# Returns the mail adresses of users that should be notified for the issue
|
||||||
def recipients
|
def recipients
|
||||||
recipients = project.recipients
|
recipients = project.recipients
|
||||||
# Author and assignee are always notified
|
# Author and assignee are always notified unless they have been locked
|
||||||
recipients << author.mail if author
|
recipients << author.mail if author && author.active?
|
||||||
recipients << assigned_to.mail if assigned_to
|
recipients << assigned_to.mail if assigned_to && assigned_to.active?
|
||||||
recipients.compact.uniq
|
recipients.compact.uniq
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
class MessageObserver < ActiveRecord::Observer
|
class MessageObserver < ActiveRecord::Observer
|
||||||
def after_create(message)
|
def after_create(message)
|
||||||
# send notification to the authors of the thread
|
# send notification to the authors of the thread
|
||||||
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
|
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author && m.author.active?}
|
||||||
# send notification to the board watchers
|
# send notification to the board watchers
|
||||||
recipients += message.board.watcher_recipients
|
recipients += message.board.watcher_recipients
|
||||||
recipients = recipients.compact.uniq
|
recipients = recipients.compact.uniq
|
||||||
|
@ -37,7 +37,7 @@ module Redmine
|
|||||||
end
|
end
|
||||||
|
|
||||||
def watcher_recipients
|
def watcher_recipients
|
||||||
self.watchers.collect { |w| w.user.mail }
|
self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
|
||||||
end
|
end
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user