From c517f52cd777222c90e0a10d09c7db1188a04ad3 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 14 May 2002 20:30:56 +0000 Subject: Previous fix reverted. (get_content): Handle the case where a multipart's 2002-05-13 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_get_message): Previous fix reverted. (get_content): Handle the case where a multipart's parent is a message/rfc822 part. Fixes bug #24136. svn path=/trunk/; revision=16789 --- camel/providers/imap/camel-imap-folder.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'camel/providers/imap/camel-imap-folder.c') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 3a1a62205b..627e31bf14 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1502,11 +1502,16 @@ get_content (CamelImapFolder *imap_folder, const char *uid, camel_multipart_set_boundary (body_mp, NULL); speclen = strlen (part_spec); - child_spec = g_malloc (speclen + 15); + child_spec = g_malloc (speclen + 18); memcpy (child_spec, part_spec, speclen); if (speclen > 0) child_spec[speclen++] = '.'; + if (ci->parent && header_content_type_is (ci->parent->type, "message", "rfc822")) { + child_spec[speclen++] = '1'; + child_spec[speclen++] = '.'; + } + ci = ci->childs; num = 1; while (ci) { @@ -1542,7 +1547,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid, ci = ci->next; } g_free (child_spec); - + return (CamelDataWrapper *)body_mp; } else if (header_content_type_is (ci->type, "message", "rfc822")) { return (CamelDataWrapper *) @@ -1552,7 +1557,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid, child_spec = g_strdup_printf ("%s%s1", part_spec, *part_spec ? "." : ""); else child_spec = g_strdup (part_spec); - + content = camel_imap_wrapper_new (imap_folder, ci->type, uid, child_spec, part); g_free (child_spec); return content; @@ -1675,7 +1680,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex) } response = camel_imap_command (store, folder, ex, - "UID FETCH %s BODYSTRUCTURE", uid); + "UID FETCH %s BODY", uid); if (!response) { camel_folder_summary_info_free (folder->summary, mi); return NULL; -- cgit v1.2.3