dovecot-2.2: lib-storage: Fixed setting \Recent flags for sessio...

dovecot at dovecot.org dovecot at dovecot.org
Mon Feb 25 17:48:21 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/10c1eb4ddef2
changeset: 15953:10c1eb4ddef2
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Feb 24 15:52:57 2013 +0200
description:
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.

diffstat:

 src/lib-storage/index/index-storage.h |  2 +-
 src/lib-storage/index/index-sync.c    |  4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r cd413ab7aeb3 -r 10c1eb4ddef2 src/lib-storage/index/index-storage.h
--- a/src/lib-storage/index/index-storage.h	Sun Feb 24 15:50:26 2013 +0200
+++ b/src/lib-storage/index/index-storage.h	Sun Feb 24 15:52:57 2013 +0200
@@ -37,7 +37,7 @@
 	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 -r cd413ab7aeb3 -r 10c1eb4ddef2 src/lib-storage/index/index-sync.c
--- a/src/lib-storage/index/index-sync.c	Sun Feb 24 15:50:26 2013 +0200
+++ b/src/lib-storage/index/index-sync.c	Sun Feb 24 15:52:57 2013 +0200
@@ -348,7 +348,9 @@
 	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,


More information about the dovecot-cvs mailing list