changeset 12116:02d78c4a0a51

dsync: Fixed creating \noselect mailboxes.
author Timo Sirainen <tss@iki.fi>
date Tue, 14 Sep 2010 16:43:10 +0100
parents 7305a7787536
children 7f364dafc675
files src/dsync/dsync-worker-local.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/dsync/dsync-worker-local.c	Tue Sep 14 16:20:18 2010 +0100
+++ b/src/dsync/dsync-worker-local.c	Tue Sep 14 16:43:10 2010 +0100
@@ -1109,8 +1109,9 @@
 	struct local_dsync_mailbox *lbox;
 	const char *name;
 
-	lbox = hash_table_lookup(worker->mailbox_hash,
-				 &dsync_box->mailbox_guid);
+	lbox = dsync_mailbox_is_noselect(dsync_box) ? NULL :
+		hash_table_lookup(worker->mailbox_hash,
+				  &dsync_box->mailbox_guid);
 	if (lbox != NULL) {
 		/* use the existing known mailbox name */
 		return mailbox_alloc(lbox->ns->list, lbox->storage_name, 0);
@@ -1125,8 +1126,10 @@
 
 	name = local_worker_convert_mailbox_name(worker, name, ns,
 						 dsync_box, creating);
-	local_dsync_worker_add_mailbox(worker, ns, name,
-				       &dsync_box->mailbox_guid);
+	if (!dsync_mailbox_is_noselect(dsync_box)) {
+		local_dsync_worker_add_mailbox(worker, ns, name,
+					       &dsync_box->mailbox_guid);
+	}
 	return mailbox_alloc(ns->list, name, 0);
 }