summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-08-03 10:46:53 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2013-08-03 10:46:53 +0000
commit7711e37da4f471b8ed7307090d055f650e2b1e13 (patch)
treed170b1d9d197fc82353320583a0b89eb4cb1c19a
parentf5658df8db2616130a118999ca43b6baeaaeda09 (diff)
downloadredmine-7711e37da4f471b8ed7307090d055f650e2b1e13.tar.gz
redmine-7711e37da4f471b8ed7307090d055f650e2b1e13.zip
remove ineffective "logger.info" and "logger.error" check from MailHandler model (#14598)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12073 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/mail_handler.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index 844c69c6c..fec2675fc 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -76,7 +76,7 @@ class MailHandler < ActionMailer::Base
sender_email = email.from.to_a.first.to_s.strip
# Ignore emails received from the application emission address to avoid hell cycles
if sender_email.downcase == Setting.mail_from.to_s.strip.downcase
- if logger && logger.info
+ if logger
logger.info "MailHandler: ignoring email from Redmine emission address [#{sender_email}]"
end
return false
@@ -87,7 +87,7 @@ class MailHandler < ActionMailer::Base
if value
value = value.to_s.downcase
if (ignored_value.is_a?(Regexp) && value.match(ignored_value)) || value == ignored_value
- if logger && logger.info
+ if logger
logger.info "MailHandler: ignoring email with #{key}:#{value} header"
end
return false
@@ -96,7 +96,7 @@ class MailHandler < ActionMailer::Base
end
@user = User.find_by_mail(sender_email) if sender_email.present?
if @user && !@user.active?
- if logger && logger.info
+ if logger
logger.info "MailHandler: ignoring email from non-active user [#{@user.login}]"
end
return false
@@ -109,7 +109,7 @@ class MailHandler < ActionMailer::Base
when 'create'
@user = create_user_from_email
if @user
- if logger && logger.info
+ if logger
logger.info "MailHandler: [#{@user.login}] account created"
end
add_user_to_group(@@handler_options[:default_group])
@@ -117,14 +117,14 @@ class MailHandler < ActionMailer::Base
Mailer.account_information(@user, @user.password).deliver
end
else
- if logger && logger.error
+ if logger
logger.error "MailHandler: could not create account for [#{sender_email}]"
end
return false
end
else
# Default behaviour, emails from unknown users are ignored
- if logger && logger.info
+ if logger
logger.info "MailHandler: ignoring email from unknown user [#{sender_email}]"
end
return false
@@ -195,7 +195,7 @@ class MailHandler < ActionMailer::Base
add_watchers(issue)
issue.save!
add_attachments(issue)
- logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger && logger.info
+ logger.info "MailHandler: issue ##{issue.id} created by #{user}" if logger
issue
end
@@ -224,7 +224,7 @@ class MailHandler < ActionMailer::Base
journal.notes = cleaned_up_text_body
add_attachments(issue)
issue.save!
- if logger && logger.info
+ if logger
logger.info "MailHandler: issue ##{issue.id} updated by #{user}"
end
journal
@@ -257,7 +257,7 @@ class MailHandler < ActionMailer::Base
add_attachments(reply)
reply
else
- if logger && logger.info
+ if logger
logger.info "MailHandler: ignoring reply from [#{sender_email}] to a locked topic"
end
end