]> code.citadel.org Git - citadel.git/commitdiff
* yeesh ... more on the IMAP BODYSTRUCTURE
authorArt Cancro <ajc@citadel.org>
Tue, 16 Jan 2001 04:03:13 +0000 (04:03 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 16 Jan 2001 04:03:13 +0000 (04:03 +0000)
citadel/ChangeLog
citadel/imap_fetch.c
citadel/mime_parser.c

index 3a8883972fe003eb7005c7384ff4cb315a73ee54..b7cc4f36f94d5927a72a2cd0f50bc2c11264078e 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 573.73  2001/01/16 04:03:13  ajc
+ * yeesh ... more on the IMAP BODYSTRUCTURE
+
  Revision 573.72  2001/01/16 01:51:12  ajc
  * imap bodystructure
 
@@ -2338,4 +2341,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index f381951790e50bdd74a012f4ba0917a6610aef8a..7fe0013a29eb43ad0cfcd9a555fc1de62fc3e66a 100644 (file)
@@ -582,13 +582,13 @@ void imap_fetch_bodystructure (long msgnum, char *item,
 
                cprintf("BODYSTRUCTURE (\"TEXT\" \"PLAIN\" "
                        "(\"CHARSET\" \"US-ASCII\") NIL NIL "
-                       "\"7BIT\" %ld %ld) ", bytes, lines);
+                       "\"7BIT\" %ld %ld)", bytes, lines);
 
                return;
        }
 
        /* For messages already stored in RFC822 format, we have to parse. */
-       cprintf("BODYSTRUCTURE (");
+       cprintf("BODYSTRUCTURE ");
        mime_parser(msg->cm_fields['M'],
                        NULL,
                        *imap_fetch_bodystructure_part, /* part */
@@ -596,7 +596,6 @@ void imap_fetch_bodystructure (long msgnum, char *item,
                        *imap_fetch_bodystructure_post, /* post-multi */
                        NULL,
                        0);
-       cprintf(") ");
 }
 
 
index ea431d9fd4ccc22d9c9cd1f7987f273a6859bda9..fdacfb4c5aef0a178235ef1b77b4d11b87856241 100644 (file)
@@ -141,8 +141,11 @@ void mime_decode(char *partnum,
 
        /* If this part is not encoded, send as-is */
        if ( (strlen(encoding) == 0) || (dont_decode)) {
-               CallBack(name, filename, partnum, disposition, part_start,
-                        content_type, length, encoding, userdata);
+               if (CallBack != NULL) {
+                       CallBack(name, filename, partnum,
+                               disposition, part_start,
+                               content_type, length, encoding, userdata);
+                       }
                return;
        }
        if ((strcasecmp(encoding, "base64"))
@@ -219,9 +222,10 @@ void mime_decode(char *partnum,
                bytes_recv = bytes_recv + blocksize;
        }
 
-       if (bytes_recv > 0)
+       if (bytes_recv > 0) if (CallBack != NULL) {
                CallBack(name, filename, partnum, disposition, decoded,
                         content_type, bytes_recv, "binary", userdata);
+       }
 
        phree(decoded);
 }
@@ -351,11 +355,16 @@ void the_mime_parser(char *partnum,
        if (is_multipart) {
 
                /* Tell the client about this message's multipartedness */
-               PreMultiPartCallBack("", "", partnum, "", NULL, content_type,
+               if (PreMultiPartCallBack != NULL) {
+                       PreMultiPartCallBack("", "", partnum, "",
+                               NULL, content_type,
                                0, encoding, userdata);
+               }
                /*
-               CallBack("", "", partnum, "", NULL, content_type,
+               if (CallBack != NULL) {
+                       CallBack("", "", partnum, "", NULL, content_type,
                                0, encoding, userdata);
+               }
                 */
 
                /* Figure out where the boundaries are */
@@ -389,8 +398,10 @@ void the_mime_parser(char *partnum,
                                part_start = ptr;
                        }
                } while (strcasecmp(buf, endary));
-END_MULTI:     PostMultiPartCallBack("", "", partnum, "", NULL, content_type,
-                               0, encoding, userdata);
+END_MULTI:     if (PostMultiPartCallBack != NULL) {
+                       PostMultiPartCallBack("", "", partnum, "", NULL,
+                               content_type, 0, encoding, userdata);
+               }
                return;
        }