[evolution] Bug #724437 - Content-Disposition inline confuses message formatter



commit bc2fd7b35695bc18a5f9dd0111d58d93d7e19d9b
Author: Milan Crha <mcrha redhat com>
Date:   Tue Feb 18 12:37:12 2014 +0100

    Bug #724437 - Content-Disposition inline confuses message formatter

 em-format/e-mail-parser-message.c |    3 ++-
 em-format/e-mail-part-utils.c     |    5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/em-format/e-mail-parser-message.c b/em-format/e-mail-parser-message.c
index 95446c0..282cef4 100644
--- a/em-format/e-mail-parser-message.c
+++ b/em-format/e-mail-parser-message.c
@@ -26,6 +26,7 @@
 #include <libemail-engine/libemail-engine.h>
 
 #include "e-mail-parser-extension.h"
+#include "e-mail-part-attachment.h"
 #include "e-mail-part-utils.h"
 
 typedef EMailParserExtension EMailParserMessage;
@@ -96,7 +97,7 @@ empe_message_parse (EMailParserExtension *extension,
         * bar but also set the "force_inline" flag since it doesn't make
         * sense to collapse the message body if we can render it. */
        mail_part = g_queue_peek_head (&work_queue);
-       if (mail_part != NULL) {
+       if (mail_part != NULL && !E_IS_MAIL_PART_ATTACHMENT (mail_part)) {
                if (e_mail_part_get_is_attachment (mail_part)) {
                        e_mail_parser_wrap_as_attachment (
                                parser, part, part_id, &work_queue);
diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c
index 64b929d..5b0072e 100644
--- a/em-format/e-mail-part-utils.c
+++ b/em-format/e-mail-part-utils.c
@@ -533,8 +533,10 @@ e_mail_part_is_inline (CamelMimePart *mime_part,
        EMailParserExtension *extension;
        EMailParserExtensionClass *class;
 
+       disposition = camel_mime_part_get_disposition (mime_part);
+
        if ((extensions == NULL) || g_queue_is_empty (extensions))
-               return FALSE;
+               return disposition && g_ascii_strcasecmp (disposition, "inline") == 0;
 
        extension = g_queue_peek_head (extensions);
        class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension);
@@ -544,7 +546,6 @@ e_mail_part_is_inline (CamelMimePart *mime_part,
        if (class->flags & E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION)
                return TRUE;
 
-       disposition = camel_mime_part_get_disposition (mime_part);
        if (disposition != NULL)
                return g_ascii_strcasecmp (disposition, "inline") == 0;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]