aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/incoming_message.rb24
-rw-r--r--app/models/request_mailer.rb6
-rw-r--r--todo.txt22
3 files changed, 43 insertions, 9 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 7071970dc..c354a8554 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.140 2008-08-31 12:46:15 francis Exp $
+# $Id: incoming_message.rb,v 1.141 2008-09-01 16:09:18 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -54,6 +54,28 @@ module TMail
return nil
end
end
+
+ end
+
+ class Address
+ # Monkeypatch!
+ def Address.encode_quoted_string(text)
+ if text.match(/[^A-Za-z0-9!#\$%&'*+\-\/=?^_`{|}~]/)
+ # Contains characters which aren't valid in atoms, so make a
+ # quoted-pair instead.
+ text.gsub!(/(["\\])/, "\\\\\\1")
+ text = '"' + text + '"'
+ end
+ return text
+ end
+
+ def quoted_full
+ if self.name
+ Address.encode_quoted_string(self.name) + " <" + self.spec + ">"
+ else
+ self.spec
+ end
+ end
end
end
diff --git a/app/models/request_mailer.rb b/app/models/request_mailer.rb
index 3d30e8418..1ffdd1e4c 100644
--- a/app/models/request_mailer.rb
+++ b/app/models/request_mailer.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: request_mailer.rb,v 1.50 2008-09-01 15:10:17 francis Exp $
+# $Id: request_mailer.rb,v 1.51 2008-09-01 16:09:18 francis Exp $
class RequestMailer < ApplicationMailer
@@ -31,7 +31,7 @@ class RequestMailer < ApplicationMailer
if incoming_message_followup.nil?
return info_request.recipient_name_and_email
else
- return incoming_message_followup.mail.from_addrs.to_s
+ return incoming_message_followup.mail.from_addrs[0].quoted_full
end
end
# Used in the preview of followup
@@ -46,7 +46,7 @@ class RequestMailer < ApplicationMailer
# Incoming message arrived for a request, but new responses have been stopped.
def stopped_responses(info_request, email)
@from = contact_from_name_and_email
- @recipients = email.from_addrs.to_s
+ @recipients = email.from_addrs[0].quoted_full
@subject = "Your response to an FOI request was not delivered"
email.setup_forward(self)
@body = {
diff --git a/todo.txt b/todo.txt
index 76c2ea6fe..e7447f02d 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,5 +1,9 @@
-Test data for Tony
Check email address of replies
+ - validate the email address itself
+ - and fix parser bug for @ in prefix
+ - maybe use subject in followup
+
+Test data for Tony
Site move:
Install PostgresSQL 8.3
@@ -9,6 +13,9 @@ Site move:
Next
====
+Add no robots to requested similar to stop google scanning
+ use HTML meta
+
Internal review status/marker?
http://www.whatdotheyknow.com/request/search_engine_advertising_bought
http://www.whatdotheyknow.com/request/communications_from_home_office
@@ -33,6 +40,7 @@ Payment required
Request withdrawn by user status/marker?
Grrr - so here I wanted to clarify my request, but don't want the timer to be reset!
http://www.whatdotheyknow.com/request/online_petitions_documents_from#incoming-3248
+Perhaps encourage user to annotate what they learnt after getting information?
Clear out all the need admin attention requests
Clear out all the need classifying requests
@@ -55,12 +63,9 @@ http://www.whatdotheyknow.com/search/variety:comment/newest
Try changing "email me" link to something else like "track by email"
CSS things
+ - CSS error on "all councils" page on some browsers
- Need Icon for annotations in search results
- Icon for government departments is too Parliamentary
- - CSS error on "all councils" page on some browsers
- - Right sidebar on requests page is too narrow
- - Sidebar text overlapping on Linux
- - Login dialog CSS on Linux
Merge workflow into one stream - find information, if you can't find it then request it.
so just search is on front page, with popular stuff below a la Google Directory
@@ -79,6 +84,7 @@ Later
=====
Search FAQ and other help pages with normal search
+ - also the "notes" section on an authority
Jump to a random request :)
@@ -144,6 +150,9 @@ Display current page (when not on first page), or perhaps range on both the
/list pages, and on the /..../similar pages (maybe I missed it elsewhere too).
Should make a general will_paginate like function to do this part, and call
that from /search (which has this already) too.
+Paginate request listing (and other things!) on user page, and on public
+authority page.
+http://www.whatdotheyknow.com/user/stuart_hardwicke_carruthers
Check this again after a while, for dodgy states of events:
s = InfoRequest.find(:all).select { |i| (not i.awaiting_description) and i.get_last_response_event_id and InfoRequestEvent.find(i.get_last_response_event_id).calculated_state != i.described_state }; s.size
@@ -224,6 +233,9 @@ Quoting fixing TODO:
http://www.whatdotheyknow.com/request/dual_british_and_israeli_nationa#incoming-3461
http://www.whatdotheyknow.com/request/council_functions_55#incoming-4099
http://www.whatdotheyknow.com/request/public_safety_consequential_to_c#incoming-1586
+ http://www.whatdotheyknow.com/request/functions_council_43#incoming-4509
+ http://www.whatdotheyknow.com/request/york_road_tube_re_opening_feasib#incoming-3509
+ http://www.whatdotheyknow.com/request/controlled_drinking_zones_5#incoming-4210
http://www.whatdotheyknow.com/request/public_inspection_periods_for_lo_2#outgoing-1707 # square bracket in link