From: Timo Sirainen Date: Sat, 5 Aug 2017 05:07:58 +0000 (+0900) Subject: lib-index: Fix modseq tracking for MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ X-Git-Tag: 2.2.32.rc1~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad10830805ebf6a087255fb929312a51b1eb29e9;p=thirdparty%2Fdovecot%2Fcore.git 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.) --- diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index 2353ef4172..977a9b35fe 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -1013,9 +1013,6 @@ static bool 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 @@ flag_updates_have_non_internal(const struct mail_transaction_flag_update *u, 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;