aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/prefer-plain/e-mail-parser-prefer-plain.c14
1 files changed, 14 insertions, 0 deletions
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);