dovecot-2.2: lib-index: Fixes to replacing message's keywords.

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 15:17:23 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/a87edad22199
changeset: 15274:a87edad22199
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 15:17:17 2012 +0200
description:
lib-index: Fixes to replacing message's keywords.

diffstat:

 src/lib-index/mail-index-transaction.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r f1f2a65d9a1c -r a87edad22199 src/lib-index/mail-index-transaction.c
--- a/src/lib-index/mail-index-transaction.c	Mon Oct 29 15:13:54 2012 +0200
+++ b/src/lib-index/mail-index-transaction.c	Mon Oct 29 15:17:17 2012 +0200
@@ -97,13 +97,19 @@
 {
 	uint32_t uid, latest_seq;
 
+	/* seq points to the transaction's primary view */
+	mail_index_lookup_uid(t->view, seq, &uid);
+
+	/* get the latest keywords from the updated index, or fallback to the
+	   primary view if the message is already expunged */
 	if (t->latest_view == NULL) {
 		mail_index_refresh(t->view->index);
 		t->latest_view = mail_index_view_open(t->view->index);
 	}
-	mail_index_lookup_uid(t->latest_view, seq, &uid);
 	if (mail_index_lookup_seq(t->latest_view, uid, &latest_seq))
 		mail_index_lookup_keywords(t->latest_view, latest_seq, keywords);
+	else
+		mail_index_lookup_keywords(t->view, seq, keywords);
 }
 
 static int


More information about the dovecot-cvs mailing list