FILE *output_fp;
};
-
-
-/*
- * Output the flags associated with a message. Note that this function
- * expects an index number in the array, *not* a sequence or uid number.
- */
-void imap_output_flags(int num) {
- cprintf("FLAGS (");
- if (IMAP->flags[num] & IMAP_DELETED) cprintf("\\Deleted");
- cprintf(")");
-}
-
-
-
/*
* Individual field functions for imap_do_fetch_msg() ...
*/
cprintf("UID %ld", IMAP->msgids[seq-1]);
}
+void imap_fetch_flags(struct CtdlMessage *msg) {
+ cprintf("FLAGS ()"); /* FIXME do something here */
+}
+
void imap_fetch_internaldate(struct CtdlMessage *msg) {
char buf[SIZ];
time_t msgdate;
imap_fetch_envelope(IMAP->msgids[seq-1], msg);
}
else if (!strcasecmp(itemlist[i], "FLAGS")) {
- imap_output_flags(seq-1);
+ imap_fetch_flags(msg);
}
else if (!strcasecmp(itemlist[i], "INTERNALDATE")) {
imap_fetch_internaldate(msg);
if (IMAP->num_msgs > 0)
for (i = 0; i < IMAP->num_msgs; ++i)
- if (IMAP->flags[i] & IMAP_SELECTED) {
+ if (IMAP->flags[i] & IMAP_FETCHED) {
msg = CtdlFetchMessage(IMAP->msgids[i]);
if (msg != NULL) {
imap_do_fetch_msg(i+1, msg, num_items, itemlist);
/*
* One particularly hideous aspect of IMAP is that we have to allow the client
* to specify arbitrary ranges and/or sets of messages to fetch. Citadel IMAP
- * handles this by setting the IMAP_SELECTED flag for each message specified in
+ * handles this by setting the IMAP_FETCHED flag for each message specified in
* the ranges/sets, then looping through the message array, outputting messages
* with the flag set. We don't bother returning an error if an out-of-range
* number is specified (we just return quietly) because any client braindead
* enough to request a bogus message number isn't going to notice the
* difference anyway.
*
- * This function clears out the IMAP_SELECTED bits, then sets that bit for each
+ * This function clears out the IMAP_FETCHED bits, then sets that bit for each
* message included in the specified range.
*
* Set is_uid to 1 to fetch by UID instead of sequence number.
}
/*
- * Clear out the IMAP_SELECTED flags for all messages.
+ * Clear out the IMAP_FETCHED flags for all messages.
*/
for (i = 0; i < IMAP->num_msgs; ++i) {
- IMAP->flags[i] = IMAP->flags[i] & ~IMAP_SELECTED;
+ IMAP->flags[i] = IMAP->flags[i] & ~IMAP_FETCHED;
}
/*
if ( (IMAP->msgids[i-1]>=lo)
&& (IMAP->msgids[i-1]<=hi)) {
IMAP->flags[i-1] =
- IMAP->flags[i-1] | IMAP_SELECTED;
+ IMAP->flags[i-1] | IMAP_FETCHED;
}
}
else { /* fetch by uid */
if ( (i>=lo) && (i<=hi)) {
IMAP->flags[i-1] =
- IMAP->flags[i-1] | IMAP_SELECTED;
+ IMAP->flags[i-1] | IMAP_FETCHED;
}
}
}
for (i = 0; i < IMAP->num_msgs; ++i) {
if (IMAP->flags[i] & IMAP_EXPUNGED) {
lprintf(9, "eliminating %d because expunged\n", i);
- IMAP->flags[i] = IMAP->flags[i] & ~IMAP_SELECTED;
+ IMAP->flags[i] = IMAP->flags[i] & ~IMAP_FETCHED;
}
}