diff options
author | Milan Crha <mcrha@redhat.com> | 2011-03-04 21:01:03 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-03-04 21:01:03 +0800 |
commit | f1710c9a4a28132429ef945533c0a528f27a2fb8 (patch) | |
tree | 94479410d613f74b8251822d38fdc60f0d97c913 | |
parent | 9a6f182c0d598d84f6c5b2f3c7725729931655f5 (diff) | |
download | gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar.gz gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar.bz2 gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar.lz gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar.xz gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.tar.zst gsoc2013-evolution-f1710c9a4a28132429ef945533c0a528f27a2fb8.zip |
Bug #643693 - Crash opening attached text/html mail
-rw-r--r-- | plugins/prefer-plain/prefer-plain.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 21c5a6b625..50b0d2852a 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -70,9 +70,25 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part em_format_part_as ( format, stream, part, "application/octet-stream", NULL); - } else + } else if (i == -1 && CAMEL_IS_MIME_MESSAGE (part)) { + /* message was asked to be formatted as text/html; + might be for cases where message itself is a text/html part */ + CamelMimePart *new_part; + CamelDataWrapper *content; + + content = camel_medium_get_content (CAMEL_MEDIUM (part)); + g_return_if_fail (content != NULL); + + new_part = camel_mime_part_new (); + camel_medium_set_content (CAMEL_MEDIUM (new_part), content); + + em_format_part (format, stream, new_part, NULL); + + g_object_unref (new_part); + } else { /* FIXME Not passing a GCancellable here. */ em_format_part (format, stream, part, NULL); + } g_string_truncate (format->part_id, partidlen); } |