From f7f4014e220f9ea4ca635d6fbc852f179d5c6656 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 18 Oct 2010 13:15:39 +0200 Subject: Bug #630518 - Hides calendar parts from multipart/alternative --- em-format/em-format.c | 2 ++ plugins/prefer-plain/prefer-plain.c | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/em-format/em-format.c b/em-format/em-format.c index dc20ac596d..1d0c60161a 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1136,6 +1136,8 @@ em_format_is_attachment (EMFormat *emf, || camel_content_type_is(dw->mime_type, "application", "x-inlinepgp-signed") || camel_content_type_is(dw->mime_type, "application", "x-inlinepgp-encrypted") || camel_content_type_is(dw->mime_type, "x-evolution", "evolution-rss-feed") + || camel_content_type_is(dw->mime_type, "text", "calendar") + || camel_content_type_is(dw->mime_type, "text", "x-calendar") || (camel_content_type_is (dw->mime_type, "text", "*") && camel_mime_part_get_filename (part) == NULL)); } diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 9fce56d65c..21c5a6b625 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -121,8 +121,8 @@ void org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t) { CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content ((CamelMedium *)t->part); - CamelMimePart *part, *display_part = NULL; - gint i, nparts, partidlen, displayid = 0; + CamelMimePart *part, *display_part = NULL, *calendar_part = NULL; + gint i, nparts, partidlen, displayid = 0, calendarid = 0; /* FIXME: this part-id stuff is poking private data, needs api */ partidlen = t->format->part_id->len; @@ -181,11 +181,20 @@ org_gnome_prefer_plain_multipart_alternative (gpointer ep, EMFormatHookTarget *t nparts = camel_multipart_get_number (mp); for (i=0; iformat, t->stream, display_part); + else if (calendar_part) + make_part_attachment (t->format, t->stream, calendar_part, calendarid); g_string_truncate (t->format->part_id, partidlen); } -- cgit v1.2.3