[dovecot-cvs] dovecot/src/lib-storage mail-storage-private.h, 1.53, 1.54 mail-storage.c, 1.80, 1.81 mail-storage.h, 1.130, 1.131

tss at dovecot.org tss at dovecot.org
Tue Apr 17 19:40:57 EEST 2007


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

Modified Files:
	mail-storage-private.h mail-storage.c mail-storage.h 
Log Message:
Added mailbox_transaction_commit_get_uids() which returns the UID range for
saved/copied messages.



Index: mail-storage-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage-private.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- mail-storage-private.h	17 Apr 2007 15:09:10 -0000	1.53
+++ mail-storage-private.h	17 Apr 2007 16:40:55 -0000	1.54
@@ -103,7 +103,9 @@
 		(*transaction_begin)(struct mailbox *box,
 				     enum mailbox_transaction_flags flags);
 	int (*transaction_commit)(struct mailbox_transaction_context *t,
-				  enum mailbox_sync_flags flags);
+				  enum mailbox_sync_flags flags,
+				  uint32_t *first_saved_uid_r,
+				  uint32_t *last_saved_uid_r);
 	void (*transaction_rollback)(struct mailbox_transaction_context *t);
 
 	struct mail_keywords *

Index: mail-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- mail-storage.c	17 Apr 2007 15:39:30 -0000	1.80
+++ mail-storage.c	17 Apr 2007 16:40:55 -0000	1.81
@@ -595,15 +595,26 @@
 	return box->v.transaction_begin(box, flags);
 }
 
-int mailbox_transaction_commit(struct mailbox_transaction_context **_t,
+int mailbox_transaction_commit(struct mailbox_transaction_context **t,
 			       enum mailbox_sync_flags flags)
 {
+	uint32_t tmp;
+
+	return mailbox_transaction_commit_get_uids(t, flags, &tmp, &tmp);
+}
+
+int mailbox_transaction_commit_get_uids(struct mailbox_transaction_context **_t,
+					enum mailbox_sync_flags flags,
+					uint32_t *first_saved_uid_r,
+					uint32_t *last_saved_uid_r)
+{
 	struct mailbox_transaction_context *t = *_t;
 
 	t->box->transaction_count--;
 
 	*_t = NULL;
-	return t->box->v.transaction_commit(t, flags);
+	return t->box->v.transaction_commit(t, flags, first_saved_uid_r,
+					    last_saved_uid_r);
 }
 
 void mailbox_transaction_rollback(struct mailbox_transaction_context **_t)

Index: mail-storage.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/mail-storage.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- mail-storage.h	17 Apr 2007 15:39:30 -0000	1.130
+++ mail-storage.h	17 Apr 2007 16:40:55 -0000	1.131
@@ -107,7 +107,11 @@
 	MAILBOX_TRANSACTION_FLAG_HIDE		= 0x01,
 	/* External transaction. Should be used for copying and appends,
 	   but nothing else. */
-	MAILBOX_TRANSACTION_FLAG_EXTERNAL	= 0x02
+	MAILBOX_TRANSACTION_FLAG_EXTERNAL	= 0x02,
+	/* Always assign UIDs to messages when saving/copying. Normally this
+	   is done only if the mailbox is synced, or if dest_mail parameter
+	   was non-NULL to mailbox_save_init() or mailbox_copy() */
+	MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS	= 0x04
 };
 
 enum mailbox_sync_flags {
@@ -303,6 +307,11 @@
 			  enum mailbox_transaction_flags flags);
 int mailbox_transaction_commit(struct mailbox_transaction_context **t,
 			       enum mailbox_sync_flags flags);
+/* If no messages were saved/copied, first/last_saved_uid_r are 0. */
+int mailbox_transaction_commit_get_uids(struct mailbox_transaction_context **t,
+					enum mailbox_sync_flags flags,
+					uint32_t *first_saved_uid_r,
+					uint32_t *last_saved_uid_r);
 void mailbox_transaction_rollback(struct mailbox_transaction_context **t);
 /* Return the number of active transactions for the mailbox. */
 unsigned int mailbox_transaction_get_count(struct mailbox *box);



More information about the dovecot-cvs mailing list