diff src/dsync/dsync-brain.c @ 10373:036db604f86c HEAD

dsync: Fixed problems with syncing mailbox names that are invalid on other side.
author Timo Sirainen <tss@iki.fi>
date Thu, 19 Nov 2009 17:28:48 -0500
parents b99a19d5a93c
children eba3e50fef36
line wrap: on
line diff
--- a/src/dsync/dsync-brain.c	Thu Nov 19 17:21:03 2009 -0500
+++ b/src/dsync/dsync-brain.c	Thu Nov 19 17:28:48 2009 -0500
@@ -535,11 +535,11 @@
 	if (mailbox->src->last_renamed > mailbox->dest->last_renamed) {
 		dsync_worker_rename_mailbox(brain->dest_worker,
 					    &mailbox->box.mailbox_guid,
-					    mailbox->src->name);
+					    mailbox->src);
 	} else {
 		dsync_worker_rename_mailbox(brain->src_worker,
 					    &mailbox->box.mailbox_guid,
-					    mailbox->dest->name);
+					    mailbox->dest);
 	}
 }
 
@@ -549,12 +549,12 @@
 	const struct dsync_brain_mailbox *mailbox;
 
 	array_foreach(&brain->mailbox_sync->mailboxes, mailbox) {
+		dsync_worker_update_mailbox(brain->src_worker, &mailbox->box);
+		dsync_worker_update_mailbox(brain->dest_worker, &mailbox->box);
+
 		if (mailbox->src != NULL && mailbox->dest != NULL &&
 		    strcmp(mailbox->src->name, mailbox->dest->name) != 0)
 			dsync_brain_sync_rename_mailbox(brain, mailbox);
-
-		dsync_worker_update_mailbox(brain->src_worker, &mailbox->box);
-		dsync_worker_update_mailbox(brain->dest_worker, &mailbox->box);
 	}
 }