]> code.citadel.org Git - citadel.git/commitdiff
* die crispin die
authorArt Cancro <ajc@citadel.org>
Wed, 25 Oct 2000 17:50:39 +0000 (17:50 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 25 Oct 2000 17:50:39 +0000 (17:50 +0000)
citadel/serv_imap.c
citadel/serv_imap.h

index 7290ab415c37211b183536c1f69424be511b85e1..9d395a9d5a9e961e7a6af72a135c3b5d7c733f6a 100644 (file)
@@ -55,6 +55,10 @@ void imap_free_msgids(void) {
                IMAP->msgids = NULL;
                IMAP->num_msgs = 0;
        }
+       if (IMAP->flags != NULL) {
+               phree(IMAP->flags);
+               IMAP->flags = NULL;
+       }
 }
 
 
@@ -74,7 +78,15 @@ void imap_add_single_msgid(long msgnum, void *userdata) {
                IMAP->msgids = reallok(IMAP->msgids,
                        IMAP->num_msgs * sizeof(long));
        }
+       if (IMAP->flags == NULL) {
+               IMAP->flags = mallok(IMAP->num_msgs * sizeof(long));
+       }
+       else {
+               IMAP->flags = reallok(IMAP->flags,
+                       IMAP->num_msgs * sizeof(long));
+       }
        IMAP->msgids[IMAP->num_msgs - 1] = msgnum;
+       IMAP->flags[IMAP->num_msgs - 1] = 0;
 }
 
 
index b332ee326f0dd5a905edb8c3f1c3f269cc75bf1f..930fe24e732f1cdf33d759693c23722923875f01 100644 (file)
@@ -14,6 +14,18 @@ struct citimap {
        int readonly;           /* mailbox is open read only */
        int num_msgs;           /* Number of messages being mapped */
        long *msgids;
+       unsigned int *flags;
 };
 
+/* Flags for the above struct.  Note that some of these are for internal use,
+ * and are not to be reported to IMAP clients.
+ */
+#define IMAP_ANSWERED  1
+#define IMAP_FLAGGED   2
+#define IMAP_DELETED   4
+#define IMAP_DRAFT     8
+#define IMAP_SEEN      16
+#define IMAP_FETCHED   32      /* internal */
+
+
 #define IMAP ((struct citimap *)CtdlGetUserData(SYM_IMAP))