aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-05-21 01:18:45 +0000
committerfrancis <francis>2009-05-21 01:18:45 +0000
commitb45669edf781a7cd59609a25d4f9b33e664af26e (patch)
tree01bf20f0ce25e5c7b85a69c2f214c352fc9b3bb9 /app/models/incoming_message.rb
parent03b6c1f0ff9072878d730d5a5da75db066db1dc9 (diff)
Apply censor rules to names from incoming emails.
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index d531f4eb7..99f270049 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.204 2009-05-19 01:13:48 francis Exp $
+# $Id: incoming_message.rb,v 1.205 2009-05-21 01:18:45 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -1054,10 +1054,12 @@ class IncomingMessage < ActiveRecord::Base
# Returns the name of the person the incoming message is from, or nil if
# there isn't one or if there is only an email address. XXX can probably
- # remove this and from_name_if_present (which is a monkey patch) by just
- # calling .from_addrs[0].name instead? (as RequestMailer.name_for_followup etc. do)
+ # remove from_name_if_present (which is a monkey patch) by just calling
+ # .from_addrs[0].name here instead?
def safe_mail_from
- self.mail.from_name_if_present
+ name = self.mail.from_name_if_present
+ name = self.info_request.apply_censor_rules_to_text(name)
+ return name
end
def mail_from_domain