From 7c0f4342a5d9469e6799a96551e79be5ba6b849c Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Fri, 25 Apr 2008 18:03:52 +0000 Subject: [PATCH] * src/modest-tny-msg.c: * (add_attachments): preserve attachment filename on copying attachments (fixes NB#83920). pmo-trunk-r4484 --- src/modest-tny-msg.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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) -- 1.7.9.5