changeset 14923:10c1eb4ddef2

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.
author Timo Sirainen <tss@iki.fi>
date Sun, 24 Feb 2013 15:52:57 +0200
parents cd413ab7aeb3
children cfd3f39102bd
files src/lib-storage/index/index-storage.h src/lib-storage/index/index-sync.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
 
--- 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,