changeset 5649:b0754b4d187d HEAD

Cleanups
author Timo Sirainen <tss@iki.fi>
date Tue, 22 May 2007 21:26:02 +0300
parents 119ffb997eda
children e5f0e8cf6089
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	Tue May 22 21:24:15 2007 +0300
+++ b/src/lib-index/mail-index-transaction.c	Tue May 22 21:26:02 2007 +0300
@@ -372,6 +372,9 @@
 {
 	int ret;
 
+	i_assert(t->first_new_seq >
+		 mail_index_view_get_messages_count(t->view));
+
 	if (t->cache_trans_ctx != NULL) {
 		mail_cache_transaction_commit(t->cache_trans_ctx);
                 t->cache_trans_ctx = NULL;
@@ -1004,13 +1007,16 @@
 	t->view = view;
 	t->hide_transaction = hide;
 	t->external = external;
-	t->first_new_seq = mail_index_view_get_messages_count(t->view)+1;
 	t->sync_transaction = view->index_sync_view;
 
 	if (view->syncing) {
 		/* transaction view cannot work if new records are being added
 		   in two places. make sure it doesn't happen. */
 		t->no_appends = TRUE;
+		t->first_new_seq = (uint32_t)-1;
+	} else {
+		t->first_new_seq =
+			mail_index_view_get_messages_count(t->view) + 1;
 	}
 
 	i_array_init(&t->module_contexts,