/*
- * $Id$
- *
* Implements the LIST and LSUB commands.
*
* Copyright (c) 2000-2009 by Art Cancro and others.
#include "support.h"
#include "config.h"
#include "user_ops.h"
-#include "policy.h"
#include "database.h"
#include "msgbase.h"
#include "internet_addressing.h"
-#include "imap_tools.h"
#include "serv_imap.h"
+#include "imap_tools.h"
#include "imap_fetch.h"
#include "imap_search.h"
#include "imap_store.h"
}
}
if (match) {
- cprintf("* %s (\\NoSelect \\HasChildren) \"/\" ", verb);
+ IAPrintf("* %s (\\NoSelect \\HasChildren) \"/\" ", verb);
plain_imap_strout(fl->f_name);
- cprintf("\r\n");
+ IAPuts("\r\n");
}
}
}
}
}
if (match) {
- cprintf("* %s (%s) \"/\" ", ImapFilter->verb, return_options);
+ IAPrintf("* %s (%s) \"/\" ", ImapFilter->verb, return_options);
plain_imap_strout(MailboxName);
- cprintf("\r\n");
+ IAPuts("\r\n");
}
}
}
*/
void imap_list(int num_parms, ConstStr *Params)
{
+ citimap *Imap = IMAP;
int i, j, paren_nest;
ImapRoomListFilter ImapFilter;
int selection_left = (-1);
int extended_list_in_use = 0;
if (num_parms < 4) {
- cprintf("%s BAD arguments invalid\r\n", Params[0].Key);
+ IReply("BAD arguments invalid");
return;
}
/* Strip off the outer parentheses */
if (Params[selection_left].Key[0] == '(') {
- TokenCutLeft(&IMAP->Cmd,
+ TokenCutLeft(&Imap->Cmd,
&Params[selection_left],
1);
}
if (Params[selection_right].Key[Params[selection_right].len-1] == ')') {
- TokenCutRight(&IMAP->Cmd,
+ TokenCutRight(&Imap->Cmd,
&Params[selection_right],
1);
}
/* Might as well look for these while we're in here... */
if (Params[i].Key[0] == '(')
- TokenCutLeft(&IMAP->Cmd,
+ TokenCutLeft(&Imap->Cmd,
&Params[i],
1);
if (Params[i].Key[Params[i].len-1] == ')')
- TokenCutRight(&IMAP->Cmd,
+ TokenCutRight(&Imap->Cmd,
&Params[i],
1);
* reference parameter.
*/
if ( (StrLength(ImapFilter.patterns[0]) == 0) && (extended_list_in_use == 0) ) {
- cprintf("* %s (\\Noselect) \"/\" \"\"\r\n", ImapFilter.verb);
+ IAPrintf("* %s (\\Noselect) \"/\" \"\"\r\n", ImapFilter.verb);
}
/* Non-empty mailbox names, and any form of the extended LIST command,
}
- cprintf("%s OK %s completed\r\n", Params[0].Key, ImapFilter.verb);
+ IReplyPrintf("OK %s completed", ImapFilter.verb);
}