Project

General

Profile

« Previous | Next » 

Revision 1075

Fixed: locked users should not receive email notifications.

View differences:

trunk/app/models/issue.rb
190 190
  # Returns the mail adresses of users that should be notified for the issue
191 191
  def recipients
192 192
    recipients = project.recipients
193
    # Author and assignee are always notified
194
    recipients << author.mail if author
195
    recipients << assigned_to.mail if assigned_to
193
    # Author and assignee are always notified unless they have been locked
194
    recipients << author.mail if author && author.active?
195
    recipients << assigned_to.mail if assigned_to && assigned_to.active?
196 196
    recipients.compact.uniq
197 197
  end
198 198
  
trunk/app/models/message_observer.rb
18 18
class MessageObserver < ActiveRecord::Observer
19 19
  def after_create(message)
20 20
    # send notification to the authors of the thread
21
    recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author}
21
    recipients = ([message.root] + message.root.children).collect {|m| m.author.mail if m.author && m.author.active?}
22 22
    # send notification to the board watchers
23 23
    recipients += message.board.watcher_recipients
24 24
    recipients = recipients.compact.uniq
trunk/vendor/plugins/acts_as_watchable/lib/acts_as_watchable.rb
37 37
        end
38 38
        
39 39
        def watcher_recipients
40
          self.watchers.collect { |w| w.user.mail }
40
          self.watchers.collect { |w| w.user.mail if w.user.active? }.compact
41 41
        end
42 42

  
43 43
        module ClassMethods

Also available in: Unified diff