]> code.citadel.org Git - citadel.git/commitdiff
* imap fetch keywords
authorArt Cancro <ajc@citadel.org>
Mon, 16 Oct 2000 03:56:38 +0000 (03:56 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 16 Oct 2000 03:56:38 +0000 (03:56 +0000)
citadel/imap_fetch.c

index 11330277c77a416156777db5a0866aeced463707..5b3c457ac58d8120aadb0ce2d9b0722767ac5396 100644 (file)
 #include "imap_fetch.h"
 
 
+
+/*
+ * Individual field functions for imap_do_fetch_msg() ...
+ */
+
+
+
+void imap_fetch_uid(int seq) {
+       cprintf("UID %ld", IMAP->msgids[seq-1]);
+}
+
+
 /*
  * imap_do_fetch() calls imap_do_fetch_msg() to output the deta of an
  * individual message, once it has been successfully loaded from disk.
  */
 void imap_do_fetch_msg(int seq, struct CtdlMessage *msg,
                        int num_items, char **itemlist) {
+       int i;
+
+       cprintf("* %d FETCH (", seq);
+
+       for (i=0; i<num_items; ++i) {
+
+               if (!strncasecmp(itemlist[i], "BODY[", 5)) {
+                       /* FIXME do something here */
+               }
+               else if (!strncasecmp(itemlist[i], "BODY.PEEK[", 10)) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "BODYSTRUCTURE")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "ENVELOPE")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "FLAGS")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "INTERNALDATE")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "RFC822")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "RFC822.HEADER")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "RFC822.SIZE")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "RFC822.TEXT")) {
+                       /* FIXME do something here */
+               }
+               else if (!strcasecmp(itemlist[i], "UID")) {
+                       imap_fetch_uid(seq);
+               }
+
+               if (i != num_items-1) cprintf(" ");
+       }
 
-       cprintf("* %d FETCH ", seq);
-       /* FIXME obviously we must do something here */
-       cprintf("\r\n");
+       cprintf(")\r\n");
 }