aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrancis <francis>2007-12-24 17:27:24 +0000
committerfrancis <francis>2007-12-24 17:27:24 +0000
commit3dd37f0f82c34c76d94fe08f18e08fb00dd804ec (patch)
tree97d25c1263916d02a2d555968995a6a6f5bc4a73
parent2a3f70b226c078916959bd76d272ea6626130ad7 (diff)
Show emails we know about, even though mask addresses
-rw-r--r--app/models/incoming_message.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index bb54be2bb..3a2338db0 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.12 2007-12-23 13:44:18 francis Exp $
+# $Id: incoming_message.rb,v 1.13 2007-12-24 17:27:24 francis Exp $
class IncomingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -107,8 +107,20 @@ class IncomingMessage < ActiveRecord::Base
text = self.mail.body
end
- # Format the body text
+ # Format the body text...
+
+ # Show special emails we know about
+ if not self.info_request.public_body.request_email.empty?
+ text = text.gsub(self.info_request.public_body.request_email, "[" + self.info_request.public_body.short_name + " request email]")
+ end
+ if not self.info_request.public_body.complaint_email.empty?
+ text = text.gsub(self.info_request.public_body.complaint_email, "[" + self.info_request.public_body.short_name + " complaint email]")
+ end
+ text = text.gsub(self.info_request.incoming_email, "[FOI #" + self.info_request.id.to_s + " email]")
+ # Remove all other emails
text = IncomingMessage.remove_email_addresses(text)
+
+ # Removing quoted sections, adding HTML
text = IncomingMessage.remove_quoted_sections(text)
text = CGI.escapeHTML(text)
text = MySociety::Format.make_clickable(text, :contract => 1)