[evolution] Add support for application/ics to ITIP formatter
- From: Dan VrÃtil <dvratil src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Add support for application/ics to ITIP formatter
- Date: Tue, 28 Aug 2012 12:17:11 +0000 (UTC)
commit 0a6672a1bd2354198f8d37a8f4a7ff26d4f6af78
Author: Dan VrÃtil <dvratil redhat com>
Date: Tue Aug 28 14:09:25 2012 +0200
Add support for application/ics to ITIP formatter
modules/itip-formatter/e-mail-formatter-itip.c | 4 +++-
modules/itip-formatter/e-mail-parser-itip.c | 19 +++++++++++++++++--
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 3b76127..ca6b2f6 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 6c740ad..56bbd53 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]