* (modest_tny_msg_find_body_part_from_mime_part): if body is in
the top mime part, lowcase before matching the content type so
that content types like "TEXT/plain" match properly
(fixes NB#84604).
pmo-trunk-r4461
/* no parts? assume it's single-part message */
if (tny_iterator_is_done(iter)) {
/* no parts? assume it's single-part message */
if (tny_iterator_is_done(iter)) {
- const gchar *content_type;
+ gchar *content_type;
+ gchar *content_type_lower;
+ gboolean is_text_part;
g_object_unref (G_OBJECT(iter));
g_object_unref (G_OBJECT(iter));
- content_type = tny_mime_part_get_content_type (msg);
+ content_type = g_strdup (tny_mime_part_get_content_type (msg));
+ if (content_type == NULL)
+ return NULL;
+ content_type = g_strstrip (content_type);
+ content_type_lower = g_ascii_strdown (content_type, -1);
+ g_free (content_type);
+ is_text_part = g_str_has_prefix (content_type_lower, "text/");
+ g_free (content_type_lower);
/* if this part cannot be a supported body return NULL */
/* if this part cannot be a supported body return NULL */
- if (!g_str_has_prefix (content_type, "text/")) {
return NULL;
} else {
return TNY_MIME_PART (g_object_ref(G_OBJECT(msg)));
return NULL;
} else {
return TNY_MIME_PART (g_object_ref(G_OBJECT(msg)));