changeset 15699:9b7d80a8db44

dsync: If both local and remote have the same message flags, don't go changing them.
author Timo Sirainen <tss@iki.fi>
date Thu, 31 Jan 2013 19:44:28 +0200
parents 798a335d99b0
children 067179cbabc2
files src/doveadm/dsync/dsync-mailbox-import.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Thu Jan 31 19:05:55 2013 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Thu Jan 31 19:44:28 2013 +0200
@@ -520,6 +520,11 @@
 	combined_remove = local_remove|remote_remove;
 	i_assert((combined_add & combined_remove) == 0);
 
+	/* don't change flags that are currently identical in both sides */
+	conflict_flags = local_final ^ remote_final;
+	combined_add &= conflict_flags;
+	combined_remove &= conflict_flags;
+
 	/* see if there are conflicting final flags */
 	local_wanted = (local_final|combined_add) & ~combined_remove;
 	remote_wanted = (remote_final|combined_add) & ~combined_remove;