changeset 13060:f2e9b20e21f8

sdbox: Altmove flag changes weren't immediately marked as synced. This caused the altmoves to be retried.
author Timo Sirainen <tss@iki.fi>
date Tue, 21 Feb 2012 15:21:19 +0200
parents c402fb407501
children b7e5a83866a4
files src/lib-storage/index/dbox-single/sdbox-sync.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-single/sdbox-sync.c	Wed Feb 15 04:32:14 2012 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-sync.c	Tue Feb 21 15:21:19 2012 +0200
@@ -36,6 +36,7 @@
 			    enum sdbox_sync_entry_type type)
 {
 	struct dbox_file *file;
+	enum modify_type modify_type;
 
 	switch (type) {
 	case SDBOX_SYNC_ENTRY_TYPE_EXPUNGE:
@@ -46,6 +47,13 @@
 		break;
 	case SDBOX_SYNC_ENTRY_TYPE_MOVE_FROM_ALT:
 	case SDBOX_SYNC_ENTRY_TYPE_MOVE_TO_ALT:
+		/* update flags in the sync transaction, mainly to make
+		   sure that these alt changes get marked as synced
+		   and won't be retried */
+		modify_type = type == SDBOX_SYNC_ENTRY_TYPE_MOVE_TO_ALT ?
+			MODIFY_ADD : MODIFY_REMOVE;
+		mail_index_update_flags(ctx->trans, seq, modify_type,
+					DBOX_INDEX_FLAG_ALT);
 		file = sdbox_file_init(ctx->mbox, uid);
 		dbox_sync_file_move_if_needed(file, type);
 		dbox_file_unref(&file);