]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fixed setting \Recent flags for sessions that didn't drop them.
authorTimo Sirainen <tss@iki.fi>
Sun, 24 Feb 2013 13:52:57 +0000 (15:52 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 24 Feb 2013 13:52:57 +0000 (15:52 +0200)
If another session wasn't dropping the \Recent flags, no new mails were
getting them unless the mailbox was reopened.

src/lib-storage/index/index-storage.h
src/lib-storage/index/index-sync.c

index 19717a836b930ea5ede7f1fe84bb8ae45b100467..56a86cd934b0f9307b156926070386da82aa8dd6 100644 (file)
@@ -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;
 
index 6cb70c06c4ae85a312e9014e60eaea8fda0aacec..b3404b174f93db55c9aee18917922e37f4e66947 100644 (file)
@@ -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,