Commit c4fee119 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Forum notifications are now also sent to the authors of the thread, even if they…

Forum notifications are now also sent to the authors of the thread, even if they don't watch the board.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@607 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 5bd26ede
......@@ -17,8 +17,11 @@
class MessageObserver < ActiveRecord::Observer
def after_create(message)
# send notification to board watchers
recipients = message.board.watcher_recipients
# send notification to the authors of the thread
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
# send notification to the board watchers
recipients += message.board.watcher_recipients
recipients = recipients.compact.uniq
Mailer.deliver_message_posted(message, recipients) unless recipients.empty?
end
end
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