diff options
author | francis <francis> | 2008-01-10 19:59:33 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-10 19:59:33 +0000 |
commit | c7b4e1b91656b6bef3fb85722913da479597c68c (patch) | |
tree | ba1f17225b46015511cb8f882c17944cc71f1aac /app/models/outgoing_message.rb | |
parent | 68af5db3f31dbce06cd1703680735f8cf7c2a444 (diff) |
Quote message that is being followed up to.
Diffstat (limited to 'app/models/outgoing_message.rb')
-rw-r--r-- | app/models/outgoing_message.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index a9244c652..fdd950ba5 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.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: outgoing_message.rb,v 1.20 2008-01-10 18:12:10 francis Exp $ +# $Id: outgoing_message.rb,v 1.21 2008-01-10 19:59:33 francis Exp $ class OutgoingMessage < ActiveRecord::Base belongs_to :info_request @@ -110,8 +110,17 @@ class OutgoingMessage < ActiveRecord::Base end end + # Returns the text to quote the original message when sending this one + def get_quoted_part_of_followup + if self.message_type == 'followup' && !self.incoming_message_followup.nil? + return "\n\n-----Original Message-----\n\n" + self.incoming_message_followup.get_body_for_quoting + "\n" + else + return "" + end + end + # Return body for display as HTML - def get_body_for_display + def get_body_for_html_display text = body text = MySociety::Format.make_clickable(text, :contract => 1) text = text.gsub(/\n/, '<br>') @@ -119,7 +128,6 @@ class OutgoingMessage < ActiveRecord::Base return text end - end |