[evolution-data-server/gnome-3-22] Bug 767807 - Inline non-text/image attachments hidden in message list



commit 1e42b34a2fedb088cf2d6cd94aa13aca8eba4ab6
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 20 14:01:54 2016 +0200

    Bug 767807 - Inline non-text/image attachments hidden in message list

 camel/camel-mime-message.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index c877a7a..bfd7bfb 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -1308,7 +1308,17 @@ find_attachment (CamelMimeMessage *msg,
 
                *found = (cd->disposition && g_ascii_strcasecmp (cd->disposition, "attachment") == 0);
 
-               if (!*found && (!cd->disposition || g_ascii_strcasecmp (cd->disposition, "inline") != 0)) {
+               /* If the Content-Disposition isn't an attachment, then call everything with a "filename"
+                  parameter an attachment, but only if there is no Content-Disposition header, or it's
+                  not the "inline" or it's neither text/... nor image/... Content-Type, which can be usually
+                  shown in the UI inline.
+
+                  The test for Content-Type was added for Apple Mail, which marks also for example .pdf
+                  attachments as 'inline', which broke the previous logic here.
+               */
+               if (!*found && (!cd->disposition ||
+                   g_ascii_strcasecmp (cd->disposition, "inline") != 0 ||
+                   (!camel_content_type_is (ct, "text", "*") && !camel_content_type_is (ct, "image", "*")))) 
{
                        for (param = cd->params; param && !(*found); param = param->next) {
                                if (param->name && param->value && *param->value && g_ascii_strcasecmp 
(param->name, "filename") == 0)
                                        *found = TRUE;


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