dovecot-2.1: imapc: More fixes to listing mailbox names.

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 9 13:14:18 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/3e1aad7bfd97
changeset: 13440:3e1aad7bfd97
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 09 13:14:07 2011 +0300
description:
imapc: More fixes to listing mailbox names.

diffstat:

 src/lib-storage/index/imapc/imapc-list.c    |  22 +++++++++-------------
 src/lib-storage/index/imapc/imapc-storage.c |   1 -
 2 files changed, 9 insertions(+), 14 deletions(-)

diffs (66 lines):

diff -r 0801852b2156 -r 3e1aad7bfd97 src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Fri Sep 09 13:05:33 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-list.c	Fri Sep 09 13:14:07 2011 +0300
@@ -58,7 +58,8 @@
 }
 
 static struct mailbox_node *
-imapc_list_update_tree(struct mailbox_tree_context *tree,
+imapc_list_update_tree(struct imapc_mailbox_list *list,
+		       struct mailbox_tree_context *tree,
 		       const struct imap_arg *args)
 {
 	struct mailbox_node *node;
@@ -85,18 +86,13 @@
 	}
 
 	T_BEGIN {
-		string_t *utf8_name = t_str_new(64);
+		const char *vname =
+			mailbox_list_default_get_vname(&list->list, name);
 
-		if (imap_utf7_to_utf8(name, utf8_name) < 0) {
-			str_truncate(utf8_name, 0);
-			str_append(utf8_name, name);
-		}
 		if ((info_flags & MAILBOX_NONEXISTENT) != 0)
-			node = mailbox_tree_lookup(tree, str_c(utf8_name));
-		else {
-			node = mailbox_tree_get(tree, str_c(utf8_name),
-						&created);
-		}
+			node = mailbox_tree_lookup(tree, vname);
+		else
+			node = mailbox_tree_get(tree, vname, &created);
 	} T_END;
 	if (node != NULL)
 		node->flags = info_flags;
@@ -123,7 +119,7 @@
 		if (list->mailboxes != NULL)
 			mailbox_tree_set_separator(list->mailboxes, list->sep);
 	} else {
-		(void)imapc_list_update_tree(list->mailboxes, args);
+		(void)imapc_list_update_tree(list, list->mailboxes, args);
 	}
 }
 
@@ -138,7 +134,7 @@
 		/* we haven't asked for the separator yet */
 		return;
 	}
-	node = imapc_list_update_tree(list->tmp_subscriptions != NULL ?
+	node = imapc_list_update_tree(list, list->tmp_subscriptions != NULL ?
 				      list->tmp_subscriptions :
 				      list->list.subscriptions, args);
 	if (node != NULL)
diff -r 0801852b2156 -r 3e1aad7bfd97 src/lib-storage/index/imapc/imapc-storage.c
--- a/src/lib-storage/index/imapc/imapc-storage.c	Fri Sep 09 13:05:33 2011 +0300
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Fri Sep 09 13:14:07 2011 +0300
@@ -5,7 +5,6 @@
 #include "str.h"
 #include "imap-arg.h"
 #include "imap-resp-code.h"
-#include "imap-utf7.h"
 #include "imapc-mail.h"
 #include "imapc-client-private.h"
 #include "imapc-connection.h"


More information about the dovecot-cvs mailing list