From 506f26a34248167f6d0f6d6f7280e25d783ddd97 Mon Sep 17 00:00:00 2001 From: djcb Date: Tue, 25 Sep 2012 15:20:26 +0300 Subject: [PATCH] * mu4e: unbreak attachments in forwarded messages --- lib/mu-msg-part.c | 14 +++++++------- mu/mu-cmd-server.c | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/mu-msg-part.c b/lib/mu-msg-part.c index c14e786c..e532538c 100644 --- a/lib/mu-msg-part.c +++ b/lib/mu-msg-part.c @@ -878,15 +878,15 @@ mu_msg_part_maybe_attachment (MuMsgPart *part) g_return_val_if_fail (part, FALSE); /* attachments must be leaf parts */ - if (!part->part_type && MU_MSG_PART_TYPE_LEAF) + if (!(part->part_type & MU_MSG_PART_TYPE_LEAF)) return FALSE; - /* non-textual inline parts are considered attachments as + /* non-textual parts are considered attachments as * well */ - if (part->part_type & MU_MSG_PART_TYPE_INLINE && - !(part->part_type & MU_MSG_PART_TYPE_TEXT_PLAIN) && - !(part->part_type & MU_MSG_PART_TYPE_TEXT_HTML)) - return TRUE; + /* if (!(part->part_type & MU_MSG_PART_TYPE_ATTACHMENT) && */ + /* !(part->part_type & MU_MSG_PART_TYPE_TEXT_PLAIN) && */ + /* !(part->part_type & MU_MSG_PART_TYPE_TEXT_HTML)) */ + /* return TRUE; */ - return FALSE; + return part->part_type & MU_MSG_PART_TYPE_ATTACHMENT ? TRUE : FALSE; } diff --git a/mu/mu-cmd-server.c b/mu/mu-cmd-server.c index 6ebfdfa9..86259120 100644 --- a/mu/mu-cmd-server.c +++ b/mu/mu-cmd-server.c @@ -418,12 +418,11 @@ each_part (MuMsg *msg, MuMsgPart *part, GSList **attlist) /* exclude things that don't look like proper attachments, * unless they're images */ - if (!mu_msg_part_maybe_attachment(part) || - g_strcmp0 (part->type, "image") != 0) + if (!mu_msg_part_maybe_attachment(part)) return; err = NULL; - cachefile = mu_msg_part_save_temp (msg, MU_MSG_OPTION_NONE, + cachefile = mu_msg_part_save_temp (msg, MU_MSG_OPTION_OVERWRITE, part->index, &err); if (!cachefile) { print_and_clear_g_error (&err);