From c4fee1196961665cd1aeeb12f53c0c2b58bba616 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 12 Aug 2007 10:16:30 +0000 Subject: [PATCH] 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 --- app/models/message_observer.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/models/message_observer.rb b/app/models/message_observer.rb index a3db7c86..cdf7b6ef 100644 --- a/app/models/message_observer.rb +++ b/app/models/message_observer.rb @@ -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