From: Jose Dapena Paz Date: Thu, 21 May 2009 09:51:36 +0000 (+0200) Subject: Show other bodies in attachment as other messages. X-Git-Tag: 3.0.17-rc7~5 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=4ab4ff904fc23d7cac7da69d52db8b0acc4c3525;hp=858271337fba8deddfd63653bc791ca3de8d668b Show other bodies in attachment as other messages. --- diff --git a/src/widgets/modest-attachment-view.c b/src/widgets/modest-attachment-view.c index f77cbc5..2e90fb2 100644 --- a/src/widgets/modest-attachment-view.c +++ b/src/widgets/modest-attachment-view.c @@ -282,13 +282,31 @@ modest_attachment_view_set_part_default (TnyMimePartView *self, TnyMimePart *mim g_object_unref (header); } } else { + gboolean is_other_body = FALSE; filename = g_strdup (tny_mime_part_get_filename (mime_part)); + if (filename == NULL) { + gchar *description; + description = modest_tny_mime_part_get_header_value (mime_part, "Content-Description"); + if (description) { + g_strstrip (description); + filename = description; + } + if (!filename || filename[0] == '\0') { + g_free (filename); + filename = g_strdup (_("mail_va_no_subject")); + } + is_other_body = TRUE; + } if (priv->is_purged) { file_icon_name = modest_platform_get_file_icon_name (NULL, NULL, NULL); } else { - file_icon_name = modest_platform_get_file_icon_name ( - filename, modest_tny_mime_part_get_content_type (mime_part), NULL); - show_size = TRUE; + if (is_other_body) { + file_icon_name = modest_platform_get_file_icon_name (NULL, "message/rfc822", NULL); + } else { + file_icon_name = modest_platform_get_file_icon_name ( + filename, modest_tny_mime_part_get_content_type (mime_part), NULL); + show_size = TRUE; + } } }