Adds watch/unwatch functionality at forum topic level (#1912).

Users who create/reply a topic are automatically added as watchers but are now able to unwatch the topic.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1878 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-09-19 15:32:52 +00:00
parent 9e7bce6a94
commit 16e09bfd77
7 changed files with 44 additions and 6 deletions
+3 -2
View File
@@ -17,8 +17,9 @@
class MessageObserver < ActiveRecord::Observer
def after_create(message)
# send notification to the authors of the thread
recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author && m.author.active?}
recipients = []
# send notification to the topic watchers
recipients += message.root.watcher_recipients
# send notification to the board watchers
recipients += message.board.watcher_recipients
# send notification to project members who want to be notified