]> source.dussan.org Git - redmine.git/commitdiff
Fixed: locked users should not receive email notifications.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 17 Jan 2008 19:58:03 +0000 (19:58 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 17 Jan 2008 19:58:03 +0000 (19:58 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1075 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
app/models/message_observer.rb
vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb

index 419c6cdc7253cc59225088b3f73af91153848cdf..a1c46cadf6cccc2e25e8c737d56e7ead60f880d1 100644 (file)
@@ -190,9 +190,9 @@ class Issue < ActiveRecord::Base
   # Returns the mail adresses of users that should be notified for the issue
   def recipients
     recipients = project.recipients
-    # Author and assignee are always notified
-    recipients << author.mail if author
-    recipients << assigned_to.mail if assigned_to
+    # Author and assignee are always notified unless they have been locked
+    recipients << author.mail if author && author.active?
+    recipients << assigned_to.mail if assigned_to && assigned_to.active?
     recipients.compact.uniq
   end
   
index 1c311e25faa0723f180ac85efee5606cf410ef4d..c26805c1b93bffc4be33ae0924d8083161090c5e 100644 (file)
@@ -18,7 +18,7 @@
 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}
+    recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author && m.author.active?}
     # send notification to the board watchers
     recipients += message.board.watcher_recipients
     recipients = recipients.compact.uniq
index c789017e502f893a0adc84556ab45709566dd0bc..53e4455cffd52ff0f0f15a44ad324de4037c1e0e 100644 (file)
@@ -37,7 +37,7 @@ module Redmine
         end
         
         def watcher_recipients
-          self.watchers.collect { |w| w.user.mail }
+          self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
         end
 
         module ClassMethods