aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/incoming_message.rb4
-rw-r--r--app/models/outgoing_message.rb13
2 files changed, 14 insertions, 3 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index be65a4b60..7b1e9c255 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.8 2007-12-22 02:23:35 francis Exp $
+# $Id: incoming_message.rb,v 1.9 2007-12-22 03:04:27 francis Exp $
class IncomingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -79,7 +79,7 @@ class IncomingMessage < ActiveRecord::Base
return text
end
- # Returns body text with quotes flattened, and emails removed.
+ # Returns body text as HTML with quotes flattened, and emails removed.
def get_body_for_display(collapse_quoted_sections = true)
parts = self.mail.parts
if parts.size > 0
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index af3ace9e4..2f46ce84e 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -20,7 +20,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.12 2007-12-17 00:34:55 francis Exp $
+# $Id: outgoing_message.rb,v 1.13 2007-12-22 03:04:27 francis Exp $
class OutgoingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -77,5 +77,16 @@ class OutgoingMessage < ActiveRecord::Base
raise "Message id #{self.id} has type '#{self.message_type}' status '#{self.status}' "
end
end
+
+ # Return body for display as HTML
+ def get_body_for_display
+ text = body
+ text = text.gsub(/\n/, '<br>')
+
+ return text
+ end
+
+
end
+