[IMP] mail_thread: message_process: plaintext incoming messages are preserved in pre tags.

bzr revid: tde@openerp.com-20121114111129-8nkneu1h6ij2lk99
This commit is contained in:
Thibault Delavallée
2012-11-14 12:11:29 +01:00
parent 5afe27095f
commit 17c2939ddc
+2 -2
View File
@@ -520,7 +520,7 @@ class mail_thread(osv.AbstractModel):
body = tools.ustr(body, encoding, errors='replace')
if message.get_content_type() == 'text/plain':
# text/plain -> <pre/>
body = tools.append_content_to_html(u'', body)
body = tools.append_content_to_html(u'', body, preserve=True)
else:
alternative = (message.get_content_type() == 'multipart/alternative')
for part in message.walk():
@@ -535,7 +535,7 @@ class mail_thread(osv.AbstractModel):
# 2) text/plain -> <pre/>
if part.get_content_type() == 'text/plain' and (not alternative or not body):
body = tools.append_content_to_html(body, tools.ustr(part.get_payload(decode=True),
encoding, errors='replace'))
encoding, errors='replace'), preserve=True)
# 3) text/html -> raw
elif part.get_content_type() == 'text/html':
html = tools.ustr(part.get_payload(decode=True), encoding, errors='replace')