--- /home/psankar/svn/gnome224/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c 2008-10-31 15:59:21.000000000 +0530 +++ camel/providers/groupwise/camel-groupwise-folder.c 2008-11-03 13:58:27.000000000 +0530 @@ -1342,6 +1342,9 @@ gw_update_cache (CamelFolder *folder, GL mi->info.content = camel_folder_summary_content_info_new (folder->summary); mi->info.content->type = camel_content_type_new ("multipart", "mixed"); } + + if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_TASK || type == E_GW_ITEM_TYPE_NOTE) + camel_message_info_set_user_flag ((CamelMessageInfo*)mi, "$has_cal", TRUE); } rk = e_gw_item_get_recurrence_key (item); @@ -1567,6 +1570,9 @@ gw_update_summary ( CamelFolder *folder, mi->info.content = camel_folder_summary_content_info_new (folder->summary); mi->info.content->type = camel_content_type_new ("multipart", "mixed"); } + + if (type == E_GW_ITEM_TYPE_APPOINTMENT || type == E_GW_ITEM_TYPE_TASK || type == E_GW_ITEM_TYPE_NOTE) + camel_message_info_set_user_flag ((CamelMessageInfo*)mi, "$has_cal", TRUE); } rk = e_gw_item_get_recurrence_key (item); --- /home/psankar/svn/gnome224/evolution-data-server/camel/camel-folder-summary.c 2008-10-31 15:59:21.000000000 +0530 +++ camel/camel-folder-summary.c 2008-10-31 15:52:43.000000000 +0530 @@ -3600,6 +3607,7 @@ summary_build_content_info(CamelFolderSu struct _CamelFolderSummaryPrivate *p = _PRIVATE(s); CamelMimeFilterCharset *mfc; CamelMessageContentInfo *part; + const char *calendar_header; d(printf("building content info\n")); @@ -3622,6 +3630,16 @@ summary_build_content_info(CamelFolderSu ) camel_message_info_set_flags(msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE); + calendar_header = camel_mime_parser_header (mp, "Content-class", NULL); + if (calendar_header && g_ascii_strcasecmp (calendar_header, "urn:content-classes:calendarmessage") != 0) + calendar_header = NULL; + + if (!calendar_header) + calendar_header = camel_mime_parser_header (mp, "X-Calendar-Attachment", NULL); + + if (calendar_header) + camel_message_info_set_user_flag (msginfo, "$has_cal", TRUE); + if (p->index && camel_content_type_is(ct, "text", "*")) { char *encoding; const char *charset; @@ -3751,6 +3769,7 @@ summary_build_content_info_message(Camel struct _CamelFolderSummaryPrivate *p = _PRIVATE(s); CamelMessageContentInfo *info = NULL, *child; CamelContentType *ct; + const struct _camel_header_raw *header; if (s->build_content) info = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new_from_message(s, object); @@ -3780,6 +3799,22 @@ summary_build_content_info_message(Camel camel_message_info_set_flags(msginfo, CAMEL_MESSAGE_SECURE, CAMEL_MESSAGE_SECURE); } + for (header = object->headers; header; header = header->next) { + const char *value = header->value; + + /* skip preceding spaces in the value */ + while (value && *value && isspace (*value)) + value++; + + if (header->name && value && ( + (g_ascii_strcasecmp (header->name, "Content-class") == 0 && g_ascii_strcasecmp (value, "urn:content-classes:calendarmessage") == 0) || + (g_ascii_strcasecmp (header->name, "X-Calendar-Attachment") == 0))) + break; + } + + if (header) + camel_message_info_set_user_flag (msginfo, "$has_cal", TRUE); + /* using the object types is more accurate than using the mime/types */ if (CAMEL_IS_MULTIPART(containee)) { parts = camel_multipart_get_number(CAMEL_MULTIPART(containee));