int _cmd_list_full(struct client *client, int lsub)
{
+ struct namespace *ns;
struct mail_storage *storage;
struct imap_arg *args;
enum mailbox_list_flags list_flags;
char sep_chr, sep[3];
int failed, listext;
- /* FIXME: really needs some work.. */
- storage = client->namespaces->storage;
-
- sep_chr = storage->hierarchy_sep;
- if (sep_chr == '"' || sep_chr == '\\') {
- sep[0] = '\\';
- sep[1] = sep_chr;
- sep[2] = '\0';
- } else {
- sep[0] = sep_chr;
- sep[1] = '\0';
- }
-
/* [(<options>)] <reference> <mailbox wildcards> */
if (!client_read_args(client, 0, 0, &args))
return FALSE;
return TRUE;
}
+ /* FIXME: really needs some work.. */
+ ns = namespace_find(client->namespaces, mask);
+ if (ns != NULL)
+ storage = ns->storage;
+ else
+ storage = client->namespaces->storage;
+
+ sep_chr = storage->hierarchy_sep;
+ if (sep_chr == '"' || sep_chr == '\\') {
+ sep[0] = '\\';
+ sep[1] = sep_chr;
+ sep[2] = '\0';
+ } else {
+ sep[0] = sep_chr;
+ sep[1] = '\0';
+ }
+
if (*mask == '\0' && !lsub) {
/* special request to return the hierarchy delimiter */
client_send_line(client, t_strconcat(