From: Art Cancro Date: Fri, 27 Apr 2007 21:22:09 +0000 (+0000) Subject: Completed the portion of draft-ietf-imapext-list-extensions-18 X-Git-Tag: v7.86~3402 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=415473b52070e4fd8fba0fb56ae9a631c325ba5d;p=citadel.git Completed the portion of draft-ietf-imapext-list-extensions-18 which requires the support of a parenthesized list of patterns (multiple selection patters). --- diff --git a/citadel/imap_list.c b/citadel/imap_list.c index e878590ce..466d14833 100644 --- a/citadel/imap_list.c +++ b/citadel/imap_list.c @@ -62,16 +62,23 @@ /* * Used by LIST and LSUB to show the floors in the listing */ -void imap_list_floors(char *verb, char *pattern) +void imap_list_floors(char *verb, int num_patterns, char **patterns) { int i; struct floor *fl; + int j = 0; + int match = 0; for (i = 0; i < MAXFLOORS; ++i) { fl = cgetfloor(i); if (fl->f_flags & F_INUSE) { - if (imap_mailbox_matches_pattern - (pattern, fl->f_name)) { + match = 0; + for (j=0; jf_name)) { + match = 1; + } + } + if (match) { cprintf("* %s (\\NoSelect) \"/\" ", verb); imap_strout(fl->f_name); cprintf("\r\n"); @@ -96,15 +103,19 @@ void imap_listroom(struct ctdlroom *qrbuf, void *data) int yes_output_this_room; char **data_for_callback; - char *pattern; char *verb; int subscribed_rooms_only; + int num_patterns; + char **patterns; + int i = 0; + int match = 0; /* Here's how we break down the array of pointers passed to us */ data_for_callback = data; - pattern = data_for_callback[0]; - verb = data_for_callback[1]; - subscribed_rooms_only = (int) data_for_callback[2]; + verb = data_for_callback[0]; + subscribed_rooms_only = (int) data_for_callback[1]; + num_patterns = (int) data_for_callback[2]; + patterns = (char **) data_for_callback[3]; /* Only list rooms to which the user has access!! */ yes_output_this_room = 0; @@ -123,7 +134,13 @@ void imap_listroom(struct ctdlroom *qrbuf, void *data) if (yes_output_this_room) { imap_mailboxname(buf, sizeof buf, qrbuf); - if (imap_mailbox_matches_pattern(pattern, buf)) { + match = 0; + for (i=0; i