[evolution] Bug #682019 - Always display text/plain when there's nothing else in multipart/alternative
- From: Dan VrÃtil <dvratil src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #682019 - Always display text/plain when there's nothing else in multipart/alternative
- Date: Fri, 17 Aug 2012 12:43:28 +0000 (UTC)
commit fb591577393c130df48cb33af455bf44d8875897
Author: Dan VrÃtil <dvratil redhat com>
Date: Fri Aug 17 14:43:12 2012 +0200
Bug #682019 - Always display text/plain when there's nothing else in multipart/alternative
modules/prefer-plain/e-mail-parser-prefer-plain.c | 23 ++++++++++++--------
1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/modules/prefer-plain/e-mail-parser-prefer-plain.c b/modules/prefer-plain/e-mail-parser-prefer-plain.c
index 714e4e4..b5f8db2 100644
--- a/modules/prefer-plain/e-mail-parser-prefer-plain.c
+++ b/modules/prefer-plain/e-mail-parser-prefer-plain.c
@@ -181,6 +181,8 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
gint i, nparts, partidlen;
GSList *parts;
CamelContentType *ct;
+ gboolean has_html;
+ GSList *plain_text_parts;
emp_pp = (EMailParserPreferPlain *) extension;
@@ -222,6 +224,7 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
}
nparts = camel_multipart_get_number (mp);
+ has_html = FALSE;
for (i = 0; i < nparts; i++) {
CamelMimePart *sp;
@@ -243,27 +246,21 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
} else {
sparts = e_mail_parser_parse_part (
parser, sp, part_id, cancellable);
- hide_parts (sparts);
}
} else {
sparts = e_mail_parser_parse_part (
parser, sp, part_id, cancellable);
}
+ has_html = TRUE;
parts = g_slist_concat (parts, sparts);
continue;
}
if (camel_content_type_is (ct, "text", "plain")) {
- sparts = e_mail_parser_parse_part (
- parser, sp, part_id, cancellable);
-
- if (emp_pp->mode == PREFER_HTML) {
- hide_parts (sparts);
- }
-
- parts = g_slist_concat (parts, sparts);
+ plain_text_parts = e_mail_parser_parse_part (
+ parser, sp, part_id, cancellable);
continue;
}
@@ -325,6 +322,14 @@ empe_prefer_plain_parse (EMailParserExtension *extension,
cancellable));
}
+ /* Don't hide the plain text if there's nothing else to display */
+ if ((emp_pp->mode == PREFER_HTML) && has_html) {
+ hide_parts (plain_text_parts);
+ }
+
+ parts = g_slist_concat (parts, plain_text_parts);
+
+
g_string_truncate (part_id, partidlen);
return parts;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]