aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2012-08-28 20:09:25 +0800
committerDan Vrátil <dvratil@redhat.com>2012-08-28 20:09:25 +0800
commit0a6672a1bd2354198f8d37a8f4a7ff26d4f6af78 (patch)
tree3fb6e9fe8b0909292a1796e04029efb7e8f52731 /modules
parent2773f4abee66d3572f1137fc1db8bd21c916e2bf (diff)
downloadgsoc2013-evolution-0a6672a1bd2354198f8d37a8f4a7ff26d4f6af78.tar.gz
gsoc2013-evolution-0a6672a1bd2354198f8d37a8f4a7ff26d4f6af78.tar.zst
gsoc2013-evolution-0a6672a1bd2354198f8d37a8f4a7ff26d4f6af78.zip
Add support for application/ics to ITIP formatter
Diffstat (limited to 'modules')
-rw-r--r--modules/itip-formatter/e-mail-formatter-itip.c4
-rw-r--r--modules/itip-formatter/e-mail-parser-itip.c19
2 files changed, 20 insertions, 3 deletions
diff --git a/modules/itip-formatter/e-mail-formatter-itip.c b/modules/itip-formatter/e-mail-formatter-itip.c
index 3b761276a1..ca6b2f64cd 100644
--- a/modules/itip-formatter/e-mail-formatter-itip.c
+++ b/modules/itip-formatter/e-mail-formatter-itip.c
@@ -58,7 +58,9 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
E_TYPE_MAIL_FORMATTER_EXTENSION,
e_mail_formatter_formatter_extension_interface_init));
-static const gchar * formatter_mime_types[] = { "text/calendar" , NULL };
+static const gchar * formatter_mime_types[] = { "text/calendar",
+ "application/ics",
+ NULL };
static gboolean
emfe_itip_format (EMailFormatterExtension *extension,
diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c
index 6c740ada75..56bbd53da1 100644
--- a/modules/itip-formatter/e-mail-parser-itip.c
+++ b/modules/itip-formatter/e-mail-parser-itip.c
@@ -68,7 +68,9 @@ G_DEFINE_DYNAMIC_TYPE_EXTENDED (
E_TYPE_MAIL_PARSER_EXTENSION,
e_mail_parser_parser_extension_interface_init));
-static const gchar * parser_mime_types[] = { "text/calendar", NULL };
+static const gchar * parser_mime_types[] = { "text/calendar",
+ "application/ics",
+ NULL };
static void
mail_part_itip_free (EMailPart *mail_part)
@@ -192,6 +194,8 @@ empe_itip_parse (EMailParserExtension *extension,
CamelStream *stream;
GByteArray *byte_array;
gint len;
+ const CamelContentDisposition *disposition;
+ GSList *parts;
len = part_id->len;
g_string_append_printf (part_id, ".itip");
@@ -204,6 +208,7 @@ empe_itip_parse (EMailParserExtension *extension,
(GFreeFunc) mail_part_itip_free);
itip_part->parent.mime_type = g_strdup ("text/calendar");
itip_part->parent.bind_func = bind_itip_view;
+ itip_part->parent.force_collapse = TRUE;
itip_part->delete_message = g_settings_get_boolean (settings, CONF_KEY_DELETE);
itip_part->has_organizer = FALSE;
itip_part->no_reply_wanted = FALSE;
@@ -228,9 +233,19 @@ empe_itip_parse (EMailParserExtension *extension,
(gchar *) byte_array->data, byte_array->len);
g_object_unref (stream);
+
+ parts = g_slist_append (NULL, itip_part);
+
+ disposition = camel_mime_part_get_content_disposition (part);
+ if (disposition &&
+ (g_strcmp0 (disposition->disposition, "attachment") == 0)) {
+ parts = e_mail_parser_wrap_as_attachment (
+ parser, part, parts, part_id, cancellable);
+ }
+
g_string_truncate (part_id, len);
- return g_slist_append (NULL, itip_part);
+ return parts;
}
static guint32