]> source.dussan.org Git - redmine.git/commitdiff
Fixed: email notification for changes I make still occurs when running Repository...
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Jan 2009 16:03:12 +0000 (16:03 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 3 Jan 2009 16:03:12 +0000 (16:03 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2225 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/mailer.rb

index dd4b5be873c15f4996168b5e2a005117c25e9b70..9a0f3a501279522709b24909bc5c8754fcef0aaa 100644 (file)
@@ -40,6 +40,7 @@ class Mailer < ActionMailer::Base
                     'Issue-Id' => issue.id,
                     'Issue-Author' => issue.author.login
     redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to
+    @author = journal.user
     recipients issue.recipients
     # Watchers in cc
     cc(issue.watcher_recipients - @recipients)
@@ -209,9 +210,10 @@ class Mailer < ActionMailer::Base
   def create_mail
     # Removes the current user from the recipients and cc
     # if he doesn't want to receive notifications about what he does
-    if User.current.pref[:no_self_notified]
-      recipients.delete(User.current.mail) if recipients
-      cc.delete(User.current.mail) if cc
+    @author ||= User.current
+    if @author.pref[:no_self_notified]
+      recipients.delete(@author.mail) if recipients
+      cc.delete(@author.mail) if cc
     end
     # Blind carbon copy recipients
     if Setting.bcc_recipients?