]> code.citadel.org Git - citadel.git/commitdiff
* imap
authorArt Cancro <ajc@citadel.org>
Sun, 18 Mar 2001 05:15:22 +0000 (05:15 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 18 Mar 2001 05:15:22 +0000 (05:15 +0000)
citadel/imap_tools.c
citadel/imap_tools.h
citadel/serv_imap.c

index b35ea2d55c662396bf503b0223d62ea97ea99c65..fe4de7defe0dbd70ccdfc3a60271e1604b1fe13f 100644 (file)
@@ -230,3 +230,17 @@ int imap_is_message_set(char *buf) {
 
        return(1);                              /* looks like we're good */
 }
+
+
+/*
+ * Support function for mailbox pattern name matching in LIST and LSUB
+ * Returns nonzero if the supplied mailbox name matches the supplied pattern.
+ */
+int imap_mailbox_matches_pattern(char *pattern, char *mailboxname) {
+
+       return 1;               /* FIXME */
+
+}
+
+
+
index 4115871edd84826b7b1a468449dbec02ac035db1..fef05ea2b3d082b0948318fc00762ba40748200e 100644 (file)
@@ -11,7 +11,7 @@ void imap_mailboxname(char *buf, int bufsize, struct quickroom *qrbuf);
 void imap_ial_out(struct internet_address_list *ialist);
 int imap_roomname(char *buf, int bufsize, char *foldername);
 int imap_is_message_set(char *);
-
+int imap_mailbox_matches_pattern(char *pattern, char *mailboxname);
 
 /*
  * Flags that may be returned by imap_roomname()
index d6187e01990322517e31706209d20f2bff0900fb..079d318302d757a0474c39a2806813443fc904bf 100644 (file)
@@ -473,9 +473,11 @@ void imap_lsub_listroom(struct quickroom *qrbuf, void *data) {
        ra = CtdlRoomAccess(qrbuf, &CC->usersupp);
        if (ra & UA_KNOWN) {
                imap_mailboxname(buf, sizeof buf, qrbuf);
-               cprintf("* LSUB () \"|\" ");
-               imap_strout(buf);
-               cprintf("\r\n");
+               if (imap_mailbox_matches_pattern(pattern, buf)) {
+                       cprintf("* LSUB () \"|\" ");
+                       imap_strout(buf);
+                       cprintf("\r\n");
+               }
        }
 }
 
@@ -492,8 +494,16 @@ void imap_lsub(int num_parms, char *parms[]) {
                return;
        }
        sprintf(pattern, "%s%s", parms[2], parms[3]);
-       imap_list_floors("LSUB");
-       ForEachRoom(imap_lsub_listroom, pattern);
+
+       if (strlen(parms[3])==0) {
+               cprintf("* LIST (\\Noselect) \"|\" \"\"\r\n");
+       }
+
+       else {
+               imap_list_floors("LSUB");
+               ForEachRoom(imap_lsub_listroom, pattern);
+       }
+
        cprintf("%s OK LSUB completed\r\n", parms[0]);
 }
 
@@ -515,9 +525,11 @@ void imap_list_listroom(struct quickroom *qrbuf, void *data) {
        if ( (ra & UA_KNOWN) 
          || ((ra & UA_GOTOALLOWED) && (ra & UA_ZAPPED))) {
                imap_mailboxname(buf, sizeof buf, qrbuf);
-               cprintf("* LIST () \"|\" ");
-               imap_strout(buf);
-               cprintf("\r\n");
+               if (imap_mailbox_matches_pattern(pattern, buf)) {
+                       cprintf("* LIST () \"|\" ");
+                       imap_strout(buf);
+                       cprintf("\r\n");
+               }
        }
 }
 
@@ -534,8 +546,16 @@ void imap_list(int num_parms, char *parms[]) {
                return;
        }
        sprintf(pattern, "%s%s", parms[2], parms[3]);
-       imap_list_floors("LIST");
-       ForEachRoom(imap_list_listroom, pattern);
+
+       if (strlen(parms[3])==0) {
+               cprintf("* LIST (\\Noselect) \"|\" \"\"\r\n");
+       }
+
+       else {
+               imap_list_floors("LIST");
+               ForEachRoom(imap_list_listroom, pattern);
+       }
+
        cprintf("%s OK LIST completed\r\n", parms[0]);
 }