[dovecot-cvs] dovecot/src/imap cmd-list.c,1.40,1.41

cras at dovecot.org cras at dovecot.org
Fri Sep 3 12:52:15 EEST 2004


Update of /var/lib/cvs/dovecot/src/imap
In directory talvi:/tmp/cvs-serv4912

Modified Files:
	cmd-list.c 
Log Message:
Fix for having INBOX/ namespace.



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cmd-list.c	18 Aug 2004 05:13:47 -0000	1.40
+++ cmd-list.c	3 Sep 2004 09:52:13 -0000	1.41
@@ -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));



More information about the dovecot-cvs mailing list