[dovecot-cvs] dovecot/src/imap cmd-list.c,1.51.2.3,1.51.2.4

tss at dovecot.org tss at dovecot.org
Sun Oct 8 22:42:40 UTC 2006


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

Modified Files:
      Tag: branch_1_0
	cmd-list.c 
Log Message:
Handle INBOX-prefixed namespaces better. Avoid duplicate INBOX replies if
namespace prefix is given.



Index: cmd-list.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/imap/cmd-list.c,v
retrieving revision 1.51.2.3
retrieving revision 1.51.2.4
diff -u -d -r1.51.2.3 -r1.51.2.4
--- cmd-list.c	6 Aug 2006 22:01:14 -0000	1.51.2.3
+++ cmd-list.c	8 Oct 2006 21:42:37 -0000	1.51.2.4
@@ -144,7 +144,8 @@
 			if (ctx->glob != NULL &&
 			    imap_match(ctx->glob, name) != IMAP_MATCH_YES)
 				continue;
-		} else if (strcasecmp(name, "INBOX") == 0) {
+		}
+		if (strcasecmp(name, "INBOX") == 0) {
 			if (!ctx->ns->inbox)
 				continue;
 
@@ -303,22 +304,16 @@
 		if (match < 0)
 			return;
 
+		len = strlen(ns->prefix);
 		if (match == IMAP_MATCH_YES &&
-		    (ctx->list_flags & MAILBOX_LIST_SUBSCRIBED) == 0) {
+		    (ctx->list_flags & MAILBOX_LIST_SUBSCRIBED) == 0 &&
+		    (!ctx->ns->inbox ||
+		     strncmp(ns->prefix, "INBOX", len-1) != 0)) {
 			/* 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;
-			}
-
+			flags = MAILBOX_PLACEHOLDER;
 			str_printfa(str, "* LIST (%s) \"%s\" ",
 				    mailbox_flags2str(flags, ctx->list_flags),
 				    ns->sep_str);



More information about the dovecot-cvs mailing list