aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
authorfrancis <francis>2008-12-18 18:55:22 +0000
committerfrancis <francis>2008-12-18 18:55:22 +0000
commitd0c412d09657cbc0a7c28ab3ed3dfb2f2ef65ff1 (patch)
tree8e4c08a61cd309e0509e9de9b96c592c99c08cf2 /app/models/incoming_message.rb
parent3d0a8dd7dd1f404f99cecf13c8683b405ecb12fe (diff)
Only show the name of the organisation if their domain matches that of email when rendering
incoming messages. Centralise domain stripping function.
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 913611cb1..74a8f64f7 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.175 2008-12-04 20:03:47 francis Exp $
+# $Id: incoming_message.rb,v 1.176 2008-12-18 18:55:22 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -926,6 +926,11 @@ class IncomingMessage < ActiveRecord::Base
return self.mail.safe_from
end
+ def mail_from_domain
+ return PublicBody.extract_domain_from_email(self.mail.from_addrs[0].spec)
+ end
+
+
# Has message arrived "recently"?
def recently_arrived
(Time.now - self.created_at) <= 3.days