/*
* Output the info for a MIME part in the format required by BODYSTRUCTURE.
*
- * FIXME .... this needs oodles of work to get completed.
*/
void imap_fetch_bodystructure_part(
char *name, char *filename, char *partnum, char *disp,
cprintf(" ");
cprintf("%ld ", length); /* bytes */
- cprintf("NIL "); /* lines */
- cprintf("NIL NIL NIL)"); /* I don't know what this is */
-
+ cprintf("NIL) "); /* lines */
}
* you're going to shoot a MIME? Do you need a reason to shoot Mark Crispin?
* No, and no.)
*
- * FIXME finish the implementation
*/
void imap_fetch_bodystructure (long msgnum, char *item,
struct CtdlMessage *msg) {
long lines = 0L;
long bytes = 0L;
-
/* For non-RFC822 (ordinary Citadel) messages, this is short and
* sweet...
*/
}
}
+
+/*
+ * For non-multipart messages, we need to generate a quickie partnum of "1"
+ * to return to callback functions. Some callbacks demand it.
+ */
+char *fixed_partnum(char *supplied_partnum) {
+ if (supplied_partnum == NULL) return "1";
+ if (strlen(supplied_partnum)==0) return "1";
+ return supplied_partnum;
+}
+
+
/*
* Given a message or message-part body and a length, handle any necessary
* decoding and pass the request up the stack.
/* If this part is not encoded, send as-is */
if ( (strlen(encoding) == 0) || (dont_decode)) {
if (CallBack != NULL) {
- CallBack(name, filename, partnum,
+ CallBack(name, filename, fixed_partnum(partnum),
disposition, part_start,
content_type, length, encoding, userdata);
}
}
if (bytes_recv > 0) if (CallBack != NULL) {
- CallBack(name, filename, partnum, disposition, decoded,
- content_type, bytes_recv, "binary", userdata);
+ CallBack(name, filename, fixed_partnum(partnum),
+ disposition, decoded,
+ content_type, bytes_recv, "binary", userdata);
}
phree(decoded);
}
/*
if (CallBack != NULL) {
- CallBack("", "", partnum, "", NULL, content_type,
+ CallBack("", "", fixed_partnum(partnum),
+ "", NULL, content_type,
0, encoding, userdata);
}
*/