From 624978fc2ac911e5daac08905a8d6e5c62e53694 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 26 Dec 2005 06:44:48 +0000 Subject: don't traverse inside message/rfc822 to avoid duplicated attachments. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@863 ee746299-78ed-0310-b773-934348b2243d --- src/compose.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/compose.c') diff --git a/src/compose.c b/src/compose.c index 7b463bb3..f430f2ea 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1980,19 +1980,19 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo) infile = procmsg_get_message_file_path(msginfo); - for (child = mimeinfo; child != NULL; - child = procmime_mimeinfo_next(child)) { + child = mimeinfo; + while (child != NULL) { if (child->children || child->mime_type == MIME_MULTIPART) - continue; + goto next; if (child->mime_type != MIME_MESSAGE_RFC822 && !child->filename && !child->name) - continue; + goto next; outfile = procmime_get_tmp_file_name(child); if (procmime_get_part(outfile, infile, child) < 0) { g_warning(_("Can't get the part of multipart message.")); g_free(outfile); - continue; + goto next; } compose_attach_append @@ -2001,6 +2001,12 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo) child->content_type); g_free(outfile); + +next: + if (child->mime_type == MIME_MESSAGE_RFC822) + child = child->next; + else + child = procmime_mimeinfo_next(child); } g_free(infile); -- cgit v1.2.3