aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog15
-rw-r--r--camel/providers/imap/camel-imap-folder.c36
2 files changed, 35 insertions, 16 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index b0c412f23a..0bbeaa6ce1 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,18 @@
+2004-11-09 Not Zed <NotZed@Ximian.com>
+
+ * providers/imap/camel-imap-folder.c (imap_get_message): before
+ short-circuiting the check for child content, check the child
+ content info is actually correct.
+
+2004-11-08 Not Zed <NotZed@Ximian.com>
+
+ ** See bug #69145.
+
+ * providers/imap/camel-imap-folder.c (get_message): remove spec
+ argument, always calculate it from the content-info.
+ (content_info_incomplete): recursively check the content-info for
+ completeness, not just one level.
+
2004-11-09 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-provider.c: Updated the properties
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 5eaafcbf13..6d6908e265 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -71,7 +71,7 @@
#include "camel-debug.h"
#include "camel-i18n.h"
-#define d(x) x
+#define d(x)
/* set to -1 for infinite size (suggested max command-line length is
* 1000 octets (see rfc2683), so we should keep the uid-set length to
@@ -1626,7 +1626,6 @@ imap_search_free (CamelFolder *folder, GPtrArray *uids)
static CamelMimeMessage *get_message (CamelImapFolder *imap_folder,
const char *uid,
- const char *part_specifier,
CamelMessageContentInfo *ci,
CamelException *ex);
@@ -1842,7 +1841,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
return (CamelDataWrapper *) body_mp;
} else if (camel_content_type_is (ci->type, "message", "rfc822")) {
- content = (CamelDataWrapper *) get_message (imap_folder, uid, part_spec, ci->childs, ex);
+ content = (CamelDataWrapper *) get_message (imap_folder, uid, ci->childs, ex);
g_free (part_spec);
return content;
} else {
@@ -1864,25 +1863,27 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
static CamelMimeMessage *
get_message (CamelImapFolder *imap_folder, const char *uid,
- const char *part_spec, CamelMessageContentInfo *ci,
+ CamelMessageContentInfo *ci,
CamelException *ex)
{
CamelImapStore *store = CAMEL_IMAP_STORE (CAMEL_FOLDER (imap_folder)->parent_store);
CamelDataWrapper *content;
CamelMimeMessage *msg;
CamelStream *stream;
- char *section_text;
+ char *section_text, *part_spec;
int ret;
-
+
+ part_spec = content_info_get_part_spec(ci);
+ d(printf("get message '%s'\n", part_spec));
section_text = g_strdup_printf ("%s%s%s", part_spec, *part_spec ? "." : "",
store->server_level >= IMAP_LEVEL_IMAP4REV1 ? "HEADER" : "0");
+
stream = camel_imap_folder_fetch_data (imap_folder, uid, section_text, FALSE, ex);
g_free (section_text);
+ g_free(part_spec);
if (!stream)
return NULL;
- d(printf("get message '%s'\n", part_spec));
-
msg = camel_mime_message_new ();
ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (msg), stream);
camel_object_unref (CAMEL_OBJECT (stream));
@@ -1950,12 +1951,15 @@ content_info_incomplete (CamelMessageContentInfo *ci)
if (!ci->type)
return TRUE;
- if (camel_content_type_is (ci->type, "multipart", "*") && !ci->childs)
- return TRUE;
-
- if (camel_content_type_is (ci->type, "message", "rfc822") && !ci->childs)
- return TRUE;
-
+ if (camel_content_type_is (ci->type, "multipart", "*")
+ || camel_content_type_is (ci->type, "message", "rfc822")) {
+ if (!ci->childs)
+ return TRUE;
+ for (ci = ci->childs;ci;ci=ci->next)
+ if (content_info_incomplete(ci))
+ return TRUE;
+ }
+
return FALSE;
}
@@ -1998,7 +2002,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (store->server_level < IMAP_LEVEL_IMAP4REV1
|| store->braindamaged
|| mi->size < IMAP_SMALL_BODY_SIZE
- || !mi->content->childs) {
+ || (!content_info_incomplete(mi->content) && !mi->content->childs)) {
msg = get_message_simple (imap_folder, uid, NULL, ex);
} else {
if (content_info_incomplete (mi->content)) {
@@ -2058,7 +2062,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
if (content_info_incomplete (mi->content))
msg = get_message_simple (imap_folder, uid, NULL, ex);
else
- msg = get_message (imap_folder, uid, "", mi->content, ex);
+ msg = get_message (imap_folder, uid, mi->content, ex);
}
} while (msg == NULL
&& retry < 2