[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-save.c, 1.108, 1.109

tss at dovecot.org tss at dovecot.org
Tue Apr 17 19:41:00 EEST 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv32564/lib-storage/index/mbox

Modified Files:
	mbox-save.c 
Log Message:
Added mailbox_transaction_commit_get_uids() which returns the UID range for
saved/copied messages.



Index: mbox-save.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-save.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -d -r1.108 -r1.109
--- mbox-save.c	30 Mar 2007 12:44:07 -0000	1.108
+++ mbox-save.c	17 Apr 2007 16:40:58 -0000	1.109
@@ -198,7 +198,9 @@
 	ctx->next_uid = hdr->next_uid;
 	ctx->uid_validity = hdr->uid_validity;
 	ctx->synced = TRUE;
-        t->mbox_modified = TRUE;
+	t->mbox_modified = TRUE;
+
+	t->ictx.first_saved_uid = ctx->next_uid;
 
 	mail_index_view_close(&view);
 }
@@ -272,6 +274,9 @@
 		return -1;
 	}
 
+	if ((t->ictx.flags & MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS) != 0)
+		want_mail = TRUE;
+
 	if (ctx->append_offset == (uoff_t)-1) {
 		/* first appended mail in this transaction */
 		if (mbox->mbox_lock_type != F_WRLCK) {
@@ -618,6 +623,8 @@
 
 int mbox_transaction_save_commit(struct mbox_save_context *ctx)
 {
+	struct mbox_transaction_context *t =
+		(struct mbox_transaction_context *)ctx->ctx.transaction;
 	struct stat st;
 	int ret = 0;
 
@@ -642,6 +649,8 @@
 				offsetof(struct mail_index_header, sync_size),
 				&sync_size, sizeof(sync_size), TRUE);
 		}
+
+		t->ictx.last_saved_uid = ctx->next_uid - 1;
 	}
 
 	if (!ctx->synced && ctx->mbox->mbox_fd != -1 &&



More information about the dovecot-cvs mailing list