[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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user