From 6d7b644e8e890929d267fbfffcaed5e60d9dff2a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 29 Jan 2013 14:49:27 +0100 Subject: Bug #692775 - Double-quoting message with HTML and text --- modules/prefer-plain/e-mail-parser-prefer-plain.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/prefer-plain') diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index 1351b33c6c..914b96952d 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -311,6 +311,20 @@ empe_prefer_plain_parse (EMailParserExtension *extension, if (has_calendar || (nparts > 1 && emp_pp->mode == PREFER_HTML)) hide_parts (&plain_text_parts); + if (!g_queue_is_empty (&plain_text_parts) && !g_queue_is_empty (&work_queue) && nparts > 1) { + /* a text/html part is hidden, but not marked as attachment, + thus do that now, when there exists a text/plain part */ + GList *qiter; + + for (qiter = g_queue_peek_head_link (&work_queue); qiter; qiter = g_list_next (qiter)) { + EMailPart *mpart = qiter->data; + + if (mpart && mpart->is_hidden && g_strcmp0 (mpart->mime_type, "text/html") == 0) { + mpart->is_attachment = TRUE; + } + } + } + /* plain_text parts should be always first */ e_queue_transfer (&plain_text_parts, out_mail_parts); e_queue_transfer (&work_queue, out_mail_parts); -- cgit v1.2.3