aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-03-18 05:17:14 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-03-18 05:17:14 +0800
commitec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1 (patch)
treeea44a7545e3e3bf6c230202f020faa9ca4bb975b /camel
parent3582451c12f589e97f0622c54c9df9e47e0a066d (diff)
downloadgsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar.gz
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar.bz2
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar.lz
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar.xz
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.tar.zst
gsoc2013-evolution-ec1e729d9455dd07ed09b3e6a5cfb4cfe85a27f1.zip
Checking that mi->content->type != NULL is no longer good enough to tell
2004-03-17 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_get_message): Checking that mi->content->type != NULL is no longer good enough to tell if a ContentInfo is complete (ie. contains the parsed BODY response). We need to check that th ContentInfo has children if the part is a multipart of message/rfc822 part. Apparently Zucchi didn't test his camel-folder-summary changes using IMAP. svn path=/trunk/; revision=25105
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog9
-rw-r--r--camel/providers/imap/camel-imap-folder.c25
2 files changed, 30 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 49df310c27..af600c0557 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-17 Jeffrey Stedfast <fejj@ximian.com>
+
+ * providers/imap/camel-imap-folder.c (imap_get_message): Checking
+ that mi->content->type != NULL is no longer good enough to tell if
+ a ContentInfo is complete (ie. contains the parsed BODY
+ response). We need to check that th ContentInfo has children if
+ the part is a multipart of message/rfc822 part. Apparently Zucchi
+ didn't test his camel-folder-summary changes using IMAP.
+
2004-03-17 Radek Doulik <rodo@ximian.com>
* camel-folder-summary.h: use 1<<30 for CAMEL_MESSAGE_JUNK_LEARN,
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 0835534ea1..7db367a8cb 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -71,7 +71,7 @@
#include "camel-file-utils.h"
-#define d(x)
+#define d(x) x
/* set to -1 for infinite size */
#define UID_SET_LIMIT (4096)
@@ -1746,7 +1746,7 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
part_spec = content_info_get_part_spec (ci);
- d(printf("get content '%s' '%s'\n", part_spec, camel_content_type_format(ci->type)));
+ d(printf("get content '%s' '%s' (frommsg = %d)\n", part_spec, camel_content_type_format(ci->type), frommsg));
/* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */
if (camel_content_type_is (ci->type, "multipart", "signed")) {
@@ -1801,6 +1801,8 @@ get_content (CamelImapFolder *imap_folder, const char *uid,
child_spec[speclen++] = '.';
g_free (part_spec);
+ fprintf (stderr, "here we are, trying to fetch a multipart/*: ci->childs = %p; ci->next = %p\n", ci->childs, ci->next);
+
ci = ci->childs;
num = 1;
while (ci) {
@@ -1933,6 +1935,21 @@ get_message_simple (CamelImapFolder *imap_folder, const char *uid,
return msg;
}
+static gboolean
+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;
+
+ return FALSE;
+}
+
static CamelMimeMessage *
imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
{
@@ -1967,7 +1984,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
* mi->content because camel_folder_summary_info_new always creates
* an empty content struct.)
*/
- if (!mi->content->type) {
+ if (content_info_incomplete (mi->content)) {
CamelImapResponse *response;
GData *fetch_data = NULL;
char *body, *found_uid;
@@ -2007,7 +2024,7 @@ imap_get_message (CamelFolder *folder, const char *uid, CamelException *ex)
camel_imap_response_free (store, response);
- if (!mi->content->type) {
+ if (content_info_incomplete (mi->content)) {
/* FETCH returned OK, but we didn't parse a BODY
* response. Courier will return invalid BODY
* responses for invalidly MIMEd messages, so