From: Timo Sirainen Date: Sun, 24 Feb 2013 13:52:57 +0000 (+0200) Subject: lib-storage: Fixed setting \Recent flags for sessions that didn't drop them. X-Git-Tag: 2.2.rc1~1^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2926f11b03d5c1c43e79e6d3c4cbd076d980c536;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Fixed setting \Recent flags for sessions that didn't drop them. If another session wasn't dropping the \Recent flags, no new mails were getting them unless the mailbox was reopened. --- diff --git a/src/lib-storage/index/index-storage.h b/src/lib-storage/index/index-storage.h index 19717a836b..56a86cd934 100644 --- a/src/lib-storage/index/index-storage.h +++ b/src/lib-storage/index/index-storage.h @@ -37,7 +37,7 @@ struct index_mailbox_context { struct mail_cache_field *cache_fields; ARRAY_TYPE(seq_range) recent_flags; - uint32_t recent_flags_prev_uid; + uint32_t recent_flags_prev_uid, recent_flags_last_check_nextuid; uint32_t recent_flags_count; uint32_t vsize_hdr_ext_id; diff --git a/src/lib-storage/index/index-sync.c b/src/lib-storage/index/index-sync.c index 6cb70c06c4..b3404b174f 100644 --- a/src/lib-storage/index/index-sync.c +++ b/src/lib-storage/index/index-sync.c @@ -348,7 +348,9 @@ void index_sync_update_recent_count(struct mailbox *box) uint32_t seq1, seq2; hdr = mail_index_get_header(box->view); - if (hdr->first_recent_uid > ibox->recent_flags_prev_uid) { + if (hdr->first_recent_uid > ibox->recent_flags_prev_uid || + hdr->next_uid > ibox->recent_flags_last_check_nextuid) { + ibox->recent_flags_last_check_nextuid = hdr->next_uid; mail_index_lookup_seq_range(box->view, hdr->first_recent_uid, hdr->next_uid,