]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Always update highestmodseq in mailbox list index
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 17 May 2017 14:49:25 +0000 (17:49 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 26 May 2017 06:07:28 +0000 (09:07 +0300)
This is required for mailbox-list-notify API to work correctly. For
example IMAP NOTIFY session with CONDSTORE enabled could be listening for
FlagChanges, but another session without CONDSTORE enabled could be updating
flags in a mailbox that has never been opened with CONDSTORE enabled.
NOTIFY wouldn't see this change, unless it was always written to
dovecot.list.index.

src/lib-storage/list/mailbox-list-index-status.c

index bff0aa5aad555a3228983d18f6e3c465bad4ad99..f8eb6dfe605a789c55f67749524ffeea699eeef2 100644 (file)
@@ -478,7 +478,6 @@ static bool
 index_list_has_changed(struct mailbox *box, struct mail_index_view *list_view,
                       struct index_list_changes *changes)
 {
-       struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT(box->list);
        struct mailbox_status old_status;
        struct mailbox_index_vsize old_vsize;
        guid_128_t old_guid;
@@ -504,15 +503,8 @@ index_list_has_changed(struct mailbox *box, struct mail_index_view *list_view,
        /* update highest-modseq only if they're ever been used */
        if (old_status.highest_modseq == changes->status.highest_modseq) {
                changes->hmodseq_changed = FALSE;
-       } else if (mail_index_have_modseq_tracking(box->index)) {
-               changes->hmodseq_changed = TRUE;
        } else {
-               const void *data;
-               bool expunged;
-
-               mail_index_lookup_ext(list_view, changes->seq,
-                                     ilist->hmodseq_ext_id, &data, &expunged);
-               changes->hmodseq_changed = data != NULL;
+               changes->hmodseq_changed = TRUE;
        }
        if (memcmp(&old_vsize, &changes->vsize, sizeof(old_vsize)) != 0)
                changes->vsize_changed = TRUE;