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/ChangeLog | 7 +++++++ camel/providers/imap/camel-imap-folder.c | 13 +++++++++---- camel/providers/imap/camel-imap-utils.c | 3 +-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index 485b2e7e1b..8a4d7494e1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +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. + 2002-05-13 Jeffrey Stedfast * providers/imap/camel-imap-store.c (camel_imap_store_class_init): 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; diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c index 7ee7ff807d..617b587397 100644 --- a/camel/providers/imap/camel-imap-utils.c +++ b/camel/providers/imap/camel-imap-utils.c @@ -521,7 +521,7 @@ parse_params (char **parms_p, CamelContentType *type) * @folder: an imap folder * @ci: a CamelMessageContentInfo to fill in * - * This filles in @ci with data from *@body_p. On success *@body_p + * This fills in @ci with data from *@body_p. On success *@body_p * will point to the character after the body. On failure, it will be * set to %NULL and @ci will be unchanged. **/ @@ -547,7 +547,6 @@ imap_parse_body (char **body_p, CamelFolder *folder, /* Parse the child body parts */ children = g_ptr_array_new (); - i = 0; while (body && *body == '(') { child = camel_folder_summary_content_info_new (folder->summary); g_ptr_array_add (children, child); -- cgit v1.2.3