changeset 2537:5c95f17f6f25 HEAD

Fix for having INBOX/ namespace.
author Timo Sirainen <tss@iki.fi>
date Fri, 03 Sep 2004 12:52:13 +0300
parents 0d2c47d85a3a
children 7d474e21e0c1
files src/imap/cmd-list.c
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-list.c	Fri Sep 03 12:00:18 2004 +0300
+++ b/src/imap/cmd-list.c	Fri Sep 03 12:52:13 2004 +0300
@@ -99,6 +99,9 @@
 	string_t *str, *name_str;
 	int ret;
 
+	if (ctx->list_ctx == NULL)
+		return 1;
+
 	t_push();
 	str = t_str_new(256);
 	name_str = t_str_new(256);
@@ -215,12 +218,22 @@
 
 		if (match == IMAP_MATCH_YES) {
 			/* The prefix itself matches */
+                        enum mailbox_flags flags;
 			string_t *str = t_str_new(128);
+
+			len = strlen(ns->prefix);
+			if (strncmp(ns->prefix, "INBOX", len-1) == 0) {
+				/* FIXME: INBOX prefix - we should get real
+				   mailbox flags.. */
+				flags = MAILBOX_CHILDREN;
+				ctx->inbox_found = TRUE;
+			} else {
+				flags = MAILBOX_PLACEHOLDER;
+			}
+
 			str_printfa(str, "* LIST (%s) \"%s\" ",
-				    mailbox_flags2str(MAILBOX_PLACEHOLDER,
-						      ctx->list_flags),
+				    mailbox_flags2str(flags, ctx->list_flags),
 				    ns->sep_str);
-			len = strlen(ns->prefix);
 			imap_quote_append_string(str,
 				t_strndup(ns->prefix, len-1), FALSE);
 			client_send_line(client, str_c(str));