From: Jose Dapena Paz Date: Fri, 25 Apr 2008 18:03:52 +0000 (+0000) Subject: * src/modest-tny-msg.c: X-Git-Tag: git_migration_finished~1410 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=7c0f4342a5d9469e6799a96551e79be5ba6b849c * src/modest-tny-msg.c: * (add_attachments): preserve attachment filename on copying attachments (fixes NB#83920). pmo-trunk-r4484 --- diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index de2d72c..8c8089a 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -312,8 +312,18 @@ add_attachments (TnyMimePart *part, GList *attachments_list, gboolean add_inline old_cid = tny_mime_part_get_content_id (old_attachment); attachment_part = copy_mime_part (old_attachment, err); if (attachment_part != NULL) { - tny_mime_part_set_header_pair (attachment_part, "Content-Disposition", - add_inline?"inline":"attachment"); + if (add_inline) { + tny_mime_part_set_header_pair (attachment_part, "Content-Disposition", + "inline"); + } else { + const gchar *filename; + filename = tny_mime_part_get_filename (old_attachment); + if (filename) + tny_mime_part_set_filename (attachment_part, filename); + else + tny_mime_part_set_header_pair (attachment_part, "Content-Disposition", + "attachment"); + } tny_mime_part_set_transfer_encoding (TNY_MIME_PART (attachment_part), "base64"); ret = tny_mime_part_add_part (TNY_MIME_PART (part), attachment_part); if (old_cid)