From: Jose Dapena Paz Date: Thu, 24 Apr 2008 15:49:46 +0000 (+0000) Subject: * src/modest-tny-msg.c: X-Git-Tag: git_migration_finished~1429 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=11b4a72fb11f3ee2cd144e1475b7fc2a539cc769 * src/modest-tny-msg.c: * (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 --- diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index b7c761d..de2d72c 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -442,11 +442,20 @@ modest_tny_msg_find_body_part_from_mime_part (TnyMimePart *msg, gboolean want_ht /* 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)); - 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 (!g_str_has_prefix (content_type, "text/")) { + if (!is_text_part) { return NULL; } else { return TNY_MIME_PART (g_object_ref(G_OBJECT(msg)));