From 07c0fefbd027f14c5c3c4c509f9b7e0e6970ffbd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Dapena=20Paz?= Date: Thu, 21 Jan 2010 10:22:00 +0100 Subject: [PATCH] Better attachments detection for text/calendar --- src/modest-tny-mime-part.c | 3 ++- src/widgets/modest-attachments-view.c | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/modest-tny-mime-part.c b/src/modest-tny-mime-part.c index 8f04082..3e9a473 100644 --- a/src/modest-tny-mime-part.c +++ b/src/modest-tny-mime-part.c @@ -171,7 +171,8 @@ modest_tny_mime_part_is_msg (TnyMimePart *part) down_content_type = g_ascii_strdown (content_type, -1); if ((g_str_has_prefix (down_content_type, "message/rfc822") || g_str_has_prefix (down_content_type, "multipart/") || - g_str_has_prefix (down_content_type, "text/"))) { + g_str_has_prefix (down_content_type, "text/plain") || + g_str_has_prefix (down_content_type, "text/html"))) { g_free (down_content_type); return TRUE; } else { diff --git a/src/widgets/modest-attachments-view.c b/src/widgets/modest-attachments-view.c index 2b28cfe..a83f7d8 100644 --- a/src/widgets/modest-attachments-view.c +++ b/src/widgets/modest-attachments-view.c @@ -187,7 +187,8 @@ modest_attachments_view_set_message (ModestAttachmentsView *attachments_view, Tn direct_attach = (!g_str_has_prefix (msg_content_type, "message/rfc822") && !g_str_has_prefix (msg_content_type, "multipart") && - !g_str_has_prefix (msg_content_type, "text/")); + !g_str_has_prefix (msg_content_type, "text/plain") && + !g_str_has_prefix (msg_content_type, "text/html")); g_free (msg_content_type); @@ -219,10 +220,13 @@ modest_attachments_view_set_message (ModestAttachmentsView *attachments_view, Tn if (g_str_has_prefix (content_type, "multipart/digest")) { add_digest_attachments (attachments_view, part); - } else if (body_found && g_str_has_prefix (content_type, "text/")) { + } else if (body_found && + (g_str_has_prefix (content_type, "text/plain") || + g_str_has_prefix (content_type, "text/html"))) { modest_attachments_view_add_attachment (attachments_view, part, TRUE, 0); } else if (g_str_has_prefix (content_type, "multipart/") || - g_str_has_prefix (content_type, "text/")) { + g_str_has_prefix (content_type, "text/plain") || + g_str_has_prefix (content_type, "text/html")) { body_found = TRUE; } } -- 1.7.9.5