]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fix modseq tracking for MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 5 Aug 2017 05:07:58 +0000 (14:07 +0900)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 14 Aug 2017 08:20:10 +0000 (11:20 +0300)
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.)

src/lib-index/mail-transaction-log-file.c

index 2353ef41723c834a89b459f977d7eb29f3556619..977a9b35fe20cc260dac5828d120fcc2582830a4 100644 (file)
@@ -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;