dovecot-2.2: Treat modseq updates explicitly instead of as if th...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 14:31:22 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/0f16da39121a
changeset: 15271:0f16da39121a
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 14:31:04 2012 +0200
description:
Treat modseq updates explicitly instead of as if they were flag changes.

diffstat:

 src/lib-index/mail-index-view-sync.c |  5 ++++-
 src/lib-index/mail-index.h           |  3 ++-
 src/lib-storage/index/index-sync.c   |  6 ++++--
 3 files changed, 10 insertions(+), 4 deletions(-)

diffs (53 lines):

diff -r 731046f18245 -r 0f16da39121a src/lib-index/mail-index-view-sync.c
--- a/src/lib-index/mail-index-view-sync.c	Mon Oct 29 14:19:53 2012 +0200
+++ b/src/lib-index/mail-index-view-sync.c	Mon Oct 29 14:31:04 2012 +0200
@@ -774,7 +774,10 @@
 			update = CONST_PTR_OFFSET(data, ctx->data_offset);
 		}
 
-		rec->type = MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS;
+		if (update->add_flags != 0 || update->remove_flags != 0)
+			rec->type = MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS;
+		else
+			rec->type = MAIL_INDEX_VIEW_SYNC_TYPE_MODSEQ;
 		rec->uid1 = update->uid1;
 		rec->uid2 = update->uid2;
 		break;
diff -r 731046f18245 -r 0f16da39121a src/lib-index/mail-index.h
--- a/src/lib-index/mail-index.h	Mon Oct 29 14:19:53 2012 +0200
+++ b/src/lib-index/mail-index.h	Mon Oct 29 14:31:04 2012 +0200
@@ -185,7 +185,8 @@
 
 enum mail_index_view_sync_type {
 	/* Flags or keywords changed */
-	MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS		= 0x01
+	MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS		= 0x01,
+	MAIL_INDEX_VIEW_SYNC_TYPE_MODSEQ	= 0x02
 };
 
 struct mail_index_view_sync_rec {
diff -r 731046f18245 -r 0f16da39121a src/lib-storage/index/index-sync.c
--- a/src/lib-storage/index/index-sync.c	Mon Oct 29 14:19:53 2012 +0200
+++ b/src/lib-storage/index/index-sync.c	Mon Oct 29 14:31:04 2012 +0200
@@ -143,6 +143,7 @@
 	i_array_init(&ctx->hidden_updates, 32);
 	while (mail_index_view_sync_next(ctx->sync_ctx, &sync_rec)) {
 		switch (sync_rec.type) {
+		case MAIL_INDEX_VIEW_SYNC_TYPE_MODSEQ:
 		case MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS:
 			if (!mail_index_lookup_seq_range(ctx->ctx.box->view,
 							 sync_rec.uid1,
@@ -150,10 +151,11 @@
 							 &seq1, &seq2))
 				break;
 
-			if (!sync_rec.hidden) {
+			if (!sync_rec.hidden &&
+			    sync_rec.type == MAIL_INDEX_VIEW_SYNC_TYPE_FLAGS) {
 				seq_range_array_add_range(&ctx->flag_updates,
 							  seq1, seq2);
-			} else if (array_is_created(&ctx->hidden_updates)) {
+			} else {
 				seq_range_array_add_range(&ctx->hidden_updates,
 							  seq1, seq2);
 			}


More information about the dovecot-cvs mailing list