[dovecot-cvs] dovecot/src/lib-index mail-index-transaction.c, 1.64, 1.65

cras at dovecot.org cras at dovecot.org
Thu Jun 30 23:28:57 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv9422

Modified Files:
	mail-index-transaction.c 
Log Message:
Keyword changes weren't converted properly from sequences to UIDs.



Index: mail-index-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-transaction.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- mail-index-transaction.c	28 Jun 2005 17:06:39 -0000	1.64
+++ mail-index-transaction.c	30 Jun 2005 20:28:54 -0000	1.65
@@ -149,6 +149,27 @@
 	}
 }
 
+static void keyword_updates_convert_to_uids(struct mail_index_transaction *t)
+{
+        struct mail_index_transaction_keyword_update *updates;
+	unsigned int i, count;
+
+	if (!array_is_created(&t->keyword_updates))
+		return;
+
+	updates = array_get_modifyable(&t->keyword_updates, &count);
+	for (i = 0; i < count; i++) {
+		if (array_is_created(&updates[i].add_seq)) {
+			mail_index_buffer_convert_to_uids(t,
+				&updates[i].add_seq, TRUE);
+		}
+		if (array_is_created(&updates[i].remove_seq)) {
+			mail_index_buffer_convert_to_uids(t,
+				&updates[i].remove_seq, TRUE);
+		}
+	}
+}
+
 static int
 mail_index_transaction_convert_to_uids(struct mail_index_transaction *t)
 {
@@ -156,7 +177,7 @@
 		return -1;
 
 	arrays_convert_to_uids(t, &t->ext_rec_updates, FALSE);
-	arrays_convert_to_uids(t, &t->keyword_updates, TRUE);
+        keyword_updates_convert_to_uids(t);
 
 	mail_index_buffer_convert_to_uids(t, &t->expunges, TRUE);
 	mail_index_buffer_convert_to_uids(t, &t->updates, TRUE);



More information about the dovecot-cvs mailing list