diff options
author | Dan Vrátil <dvratil@redhat.com> | 2012-06-26 21:12:23 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2012-06-26 21:26:57 +0800 |
commit | 2992ba8de93a8d57c48fbf77549ddcab6d49bccd (patch) | |
tree | 03edd70d1d88a7b85dbff79a9c37a20f99549e82 | |
parent | 99a875edae6c57fd6540818d3f0da994b135a068 (diff) | |
download | gsoc2013-evolution-2992ba8de93a8d57c48fbf77549ddcab6d49bccd.tar.gz gsoc2013-evolution-2992ba8de93a8d57c48fbf77549ddcab6d49bccd.tar.zst gsoc2013-evolution-2992ba8de93a8d57c48fbf77549ddcab6d49bccd.zip |
[prefer-plain] Fix displaying suppressed HTML parts
Fix regression from commit 99a875ed which has broken displaying
of suppressed HTML parts as attachments when the HTML part is embedded
in a multipart/* container.
-rw-r--r-- | modules/prefer-plain/e-mail-parser-prefer-plain.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c index a6f0f4c6b6..6780172224 100644 --- a/modules/prefer-plain/e-mail-parser-prefer-plain.c +++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c @@ -280,28 +280,29 @@ empe_prefer_plain_parse (EMailParserExtension *extension, sparts = e_mail_parser_parse_part ( parser, sp, part_id, cancellable); - if (emp_pp->mode != PREFER_HTML) { - hide_parts (sparts); - } else { - GSList *iter; - gboolean has_html = FALSE; - - /* Check whether the multipart contains a - * text/html part and hide the whole multipart if - * it does not. Otherwise assume that it's what - * we wan't to display */ - for (iter = sparts; iter; iter = g_slist_next (iter)) { - EMailPart *p = iter->data; - if (!p) - continue; - - if (strstr (p->id, ".text_html") != NULL) { - has_html = TRUE; - break; - } + GSList *iter; + gboolean has_html = FALSE; + + /* Check whether the multipart contains a text/html part */ + for (iter = sparts; iter; iter = g_slist_next (iter)) { + EMailPart *p = iter->data; + if (!p) + continue; + + if (strstr (p->id, ".text_html") != NULL) { + has_html = TRUE; + break; } - if (!has_html) + } + + if (has_html && (emp_pp->mode != PREFER_HTML)) { + if (emp_pp->show_suppressed) { + sparts = e_mail_parser_wrap_as_attachment ( + parser, sp, sparts, part_id, + cancellable); + } else { hide_parts (sparts); + } } parts = g_slist_concat (parts, sparts); |