+
+ /* if tinymail thinks it's an attachment, it is. One exception: if it's
+ * a multipart and it's not a message/rfc822 it cannot be an attahcment */
+ if (tny_mime_part_is_attachment (part)) {
+ if (!TNY_IS_MSG (part)) {
+ const gchar *content_type;
+ gchar *down_content_type;
+ gboolean is_attachment;
+
+ content_type = tny_mime_part_get_content_type (part);
+ down_content_type = g_ascii_strdown (content_type, -1);
+
+ is_attachment = !g_str_has_prefix (down_content_type, "multipart/");
+ g_free (down_content_type);
+ return is_attachment;
+ } else {
+ return TRUE;
+ }
+ }