aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/incoming_message.rb16
-rw-r--r--app/models/info_request.rb8
2 files changed, 17 insertions, 7 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 5374498ed..b3d6eee1c 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -17,7 +17,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.95 2008-05-05 22:58:18 francis Exp $
+# $Id: incoming_message.rb,v 1.96 2008-05-08 12:24:31 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -212,6 +212,17 @@ class IncomingMessage < ActiveRecord::Base
end
+ # Remove other stuff, such as details an FOI officer has asked to be removed.
+ def self.foi_officer_privacy(text)
+ text = text.dup
+
+ # http://www.whatdotheyknow.com/request/total_number_of_objects_in_the_n_6
+ text.gsub!(/\*\*\*+\nPolly Tucker.*/ms, "")
+
+ return text
+ end
+
+
# Remove quoted sections from emails (eventually the aim would be for this
# to do as good a job as GMail does) XXX bet it needs a proper parser
# XXX and this FOLDED_QUOTED_SECTION stuff is a mess
@@ -482,6 +493,7 @@ class IncomingMessage < ActiveRecord::Base
text = get_main_body_text
text = self.mask_special_emails(text)
text = IncomingMessage.remove_email_addresses(text)
+ text = IncomingMessage.foi_officer_privacy(text)
# Remove quoted sections, adding HTML. XXX The FOLDED_QUOTED_SECTION is
# a nasty hack so we can escape other HTML before adding the unfold
@@ -522,8 +534,10 @@ class IncomingMessage < ActiveRecord::Base
text = get_main_body_text
text = self.mask_special_emails(text)
text = IncomingMessage.remove_email_addresses(text)
+ text = IncomingMessage.foi_officer_privacy(text)
# Remove existing quoted sections
+ text = self.remove_lotus_quoting(text, '')
text = IncomingMessage.remove_quoted_sections(text, "")
end
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index eec8091e3..6b823c4b4 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: info_request.rb,v 1.102 2008-04-30 01:42:39 francis Exp $
+# $Id: info_request.rb,v 1.103 2008-05-08 12:24:31 francis Exp $
require 'digest/sha1'
require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian')
@@ -324,11 +324,7 @@ public
# Where the initial request is sent to
def recipient_email
- if MySociety::Config.getbool("STAGING_SITE", 1)
- return self.user.email
- else
- return self.public_body.request_email
- end
+ return self.public_body.request_email
end
def recipient_name_and_email
return "FOI requests at " + self.public_body.short_or_long_name + " <" + self.recipient_email + ">"