aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-02-23 01:41:03 +0000
committerFrancis Irving <francis@mysociety.org>2010-02-23 01:41:03 +0000
commitfe829aec704df665e5e0012a7e3e0f93b0406228 (patch)
tree3e5b46fb7881aad823bf2a904992cddbc00ddc32
parent0b6cb934480cc241eae2a633665e47cd78bcd941 (diff)
Use HTML part as main body part in more cases
-rw-r--r--app/models/incoming_message.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 96d890e10..121294fdb 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -893,9 +893,12 @@ class IncomingMessage < ActiveRecord::Base
def get_main_body_text_part
leaves = get_attachment_leaves
- # Find first part which is text/plain
+ # Find first part which is text/plain or text/html
+ # (We have to include HTML, as increasingly there are mail clients that
+ # include no text alternative for the main part, and we don't want to
+ # instead use the first text attachment)
leaves.each do |p|
- if p.content_type == 'text/plain'
+ if p.content_type == 'text/plain' or p.content_type == 'text/html'
return p
end
end