diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 6 | ||||
-rw-r--r-- | src/compose.c | 45 |
3 files changed, 27 insertions, 30 deletions
@@ -1,3 +1,9 @@ +2005-12-25 + + * src/compose.c: compose_attach_parts(): attach all parts with + filenames, and don't if not (fixes failure of forwarding attachments + in some cases). + 2005-12-22 * version 2.2.0beta1 diff --git a/ChangeLog.ja b/ChangeLog.ja index c8b4533e..cccdee5c 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,9 @@ +2005-12-25 + + * src/compose.c: compose_attach_parts(): ファイル名をもつすべての + パートを添付し、ファイル名がないパートは添付しないようにした + (一部のケースで添付ファイルの転送に失敗するのを修正)。 + 2005-12-22 * version 2.2.0beta1 diff --git a/src/compose.c b/src/compose.c index 7bacb9c0..7cc78c65 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1970,14 +1970,6 @@ static void compose_attach_append(Compose *compose, const gchar *file, -1); } -#define IS_FIRST_PART_TEXT(info) \ - ((info->mime_type == MIME_TEXT || info->mime_type == MIME_TEXT_HTML) || \ - (info->mime_type == MIME_MULTIPART && info->content_type && \ - !g_ascii_strcasecmp(info->content_type, "multipart/alternative") && \ - (info->children && \ - (info->children->mime_type == MIME_TEXT || \ - info->children->mime_type == MIME_TEXT_HTML)))) - static void compose_attach_parts(Compose *compose, MsgInfo *msginfo) { MimeInfo *mimeinfo; @@ -1988,41 +1980,34 @@ static void compose_attach_parts(Compose *compose, MsgInfo *msginfo) mimeinfo = procmime_scan_message(msginfo); if (!mimeinfo) return; - /* skip first text (presumably message body) */ - child = mimeinfo->children; - if (!child || IS_FIRST_PART_TEXT(mimeinfo)) { - procmime_mimeinfo_free_all(mimeinfo); - return; - } - if (IS_FIRST_PART_TEXT(child)) - child = child->next; - infile = procmsg_get_message_file_path(msginfo); - while (child != NULL) { - if (child->children || child->mime_type == MIME_MULTIPART) { - child = procmime_mimeinfo_next(child); + for (child = mimeinfo; child != NULL; + child = procmime_mimeinfo_next(child)) { + if (child->children || child->mime_type == MIME_MULTIPART) + continue; + if (!child->filename && !child->name) continue; - } outfile = procmime_get_tmp_file_name(child); - if (procmime_get_part(outfile, infile, child) < 0) + if (procmime_get_part(outfile, infile, child) < 0) { g_warning(_("Can't get the part of multipart message.")); - else - compose_attach_append - (compose, outfile, - child->filename ? child->filename : child->name, - child->content_type); + g_free(outfile); + continue; + } - child = child->next; + compose_attach_append + (compose, outfile, + child->filename ? child->filename : child->name, + child->content_type); + + g_free(outfile); } g_free(infile); procmime_mimeinfo_free_all(mimeinfo); } -#undef IS_FIRST_PART_TEXT - #define INDENT_CHARS ">|#" typedef enum { |