Skip to content

Commit

Permalink
lib-storage: Always update highestmodseq in mailbox list index
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and villesavolainen committed May 26, 2017
1 parent 8bfa9cb commit 9dbd45d
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lib-storage/list/mailbox-list-index-status.c
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 9dbd45d

Please sign in to comment.