Autoretrieve calendar parts in bodystructure
[modest] / src / modest-tny-account-store.c
index 529d027..3b82d2f 100644 (file)
@@ -884,10 +884,11 @@ volume_path_is_mounted (const gchar* path)
 
 static void _bodies_filter (TnyMsg *msg, TnyList *list)
 {
-       TnyMimePart *html_part, *text_part;
+       TnyMimePart *html_part, *text_part, *calendar_part;
 
        html_part = modest_tny_msg_find_body_part (msg, TRUE);
        text_part = modest_tny_msg_find_body_part (msg, FALSE);
+       calendar_part = modest_tny_msg_find_calendar (msg);
 
        if (text_part && TNY_IS_MIME_PART (text_part) && html_part == text_part) {
                g_object_unref (text_part);
@@ -903,6 +904,11 @@ static void _bodies_filter (TnyMsg *msg, TnyList *list)
                tny_list_prepend (list, G_OBJECT (text_part));
                g_object_unref (text_part);
        }
+
+       if (calendar_part && TNY_IS_MIME_PART (calendar_part)) {
+               tny_list_prepend (list, G_OBJECT (calendar_part));
+               g_object_unref (calendar_part);
+       }
 }