changeset 15274:a87edad22199

lib-index: Fixes to replacing message's keywords.
author Timo Sirainen <tss@iki.fi>
date Mon, 29 Oct 2012 15:17:17 +0200
parents f1f2a65d9a1c
children 4c84efce3a94
files src/lib-index/mail-index-transaction.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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