]> code.citadel.org Git - citadel.git/blobdiff - citadel/modules/imap/imap_fetch.c
More removal of $Id$ tags
[citadel.git] / citadel / modules / imap / imap_fetch.c
index 0a6ee4f1eea60ae03749535332ac0af19be90b71..29e64ed378fa2039eae736b759c2dc996c0c6f9a 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * Implements the FETCH command in IMAP.
  * This is a good example of the protocol's gratuitous complexity.
  *
@@ -283,6 +281,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);
@@ -620,9 +622,8 @@ void imap_fetch_body(long msgnum, ConstStr item, int is_peek) {
        if (strchr(ChrPtr(section), '[') != NULL) {
                StrBufStripAllBut(section, '[', ']');
        }
-       CtdlLogPrintf(CTDL_DEBUG, "Section is: %s%s\n", 
-                     ChrPtr(section), 
-                     (StrLength(section) == 0) ? "(empty)" : ""
+       CtdlLogPrintf(CTDL_DEBUG, "Section is: [%s]\n", 
+             (StrLength(section) == 0) ? "(empty)" : ChrPtr(section)
        );
 
        /* Burn the cache if we don't have the same section of the 
@@ -654,11 +655,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);
@@ -707,8 +706,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) {