changeset 22421:feb7448f94cd

lib-index: Fix modseq tracking for MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ This is used to increase modseq for mails when their private flags change. Use an already existing MAIL_TRANSACTION_FLAG_UPDATE_IS_INTERNAL() that does this properly. (This change preserves another bug, which is fixed in the next commit.)
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sat, 05 Aug 2017 14:07:58 +0900
parents 7ae7c3c159d1
children b92e6fa512df
files src/lib-index/mail-transaction-log-file.c
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log-file.c	Sun Jul 23 12:32:38 2017 +0300
+++ b/src/lib-index/mail-transaction-log-file.c	Sat Aug 05 14:07:58 2017 +0900
@@ -1013,9 +1013,6 @@
 flag_updates_have_non_internal(const struct mail_transaction_flag_update *u,
 			       unsigned int count, unsigned int version)
 {
-	const uint8_t internal_flags =
-		MAIL_INDEX_MAIL_FLAG_BACKEND | MAIL_INDEX_MAIL_FLAG_DIRTY;
-
 	/* Hide internal flags from modseqs if the log file's version
 	   is new enough. This allows upgrading without the modseqs suddenly
 	   shrinking. */
@@ -1023,9 +1020,7 @@
 		return TRUE;
 
 	for (unsigned int i = 0; i < count; i++) {
-		uint8_t changed_flags = u->add_flags | u->remove_flags;
-
-		if ((changed_flags & ~internal_flags) != 0)
+		if (!MAIL_TRANSACTION_FLAG_UPDATE_IS_INTERNAL(u))
 			return TRUE;
 	}
 	return FALSE;