]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_fetch.c
* imap_load_part() is expecting the desired_section to be a char*, not a ChrPtr....
[citadel.git] / citadel / modules / imap / imap_fetch.c
index 11303ef0dc5ea2051f9821d4c153c0163690f20b..66dd774fa03b5a6bd5154da1544f6584b5bc922e 100644 (file)
@@ -283,6 +283,10 @@ void imap_load_part(char *name, char *filename, char *partnum, char *disp,
        char *desired_section;
 
        desired_section = (char *)cbuserdata;
+       CtdlLogPrintf(CTDL_DEBUG, "imap_load_part() looking for %s, found %s\n",
+               desired_section,
+               partnum
+       );
 
        if (!strcasecmp(partnum, desired_section)) {
                client_write(content, length);
@@ -653,11 +657,9 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
                StrBufStripAllBut(partial, '<', '>');
                is_partial = 1;
        }
-       if (is_partial == 0) 
-               if (StrLength(partial) > 0) 
-                       CtdlLogPrintf(CTDL_DEBUG, 
-                                     "Partial is %s\n", 
-                                     ChrPtr(partial));
+       if ( (is_partial == 1) && (StrLength(partial) > 0) ) {
+               CtdlLogPrintf(CTDL_DEBUG, "Partial is <%s>\n", ChrPtr(partial));
+       }
 
        if (IMAP->cached_body == NULL) {
                CCC->redirect_buffer = NewStrBufPlain(NULL, SIZ);
@@ -706,8 +708,9 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        else {
                mime_parser(msg->cm_fields['M'], NULL,
                                *imap_load_part, NULL, NULL,
-                               section,
-                               1);
+                               ChrPtr(section),
+                               1
+               );
        }
 
        if (loading_body_now) {