changeset 5646:bc3652a97a0f HEAD

Added mail_index_transaction_is_expunged()
author Timo Sirainen <tss@iki.fi>
date Tue, 22 May 2007 20:19:35 +0300
parents caf10b68dad7
children 6c61d716274b
files src/lib-index/mail-index-transaction.c src/lib-index/mail-index.h
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-transaction.c	Tue May 22 20:11:01 2007 +0300
+++ b/src/lib-index/mail-index-transaction.c	Tue May 22 20:19:35 2007 +0300
@@ -94,6 +94,13 @@
 	return t->view;
 }
 
+bool mail_index_transaction_is_expunged(struct mail_index_transaction *t,
+					uint32_t seq)
+{
+	return array_is_created(&t->expunges) &&
+		seq_range_exists(&t->expunges, seq);
+}
+
 void mail_index_transaction_ref(struct mail_index_transaction *t)
 {
 	t->refcount++;
--- a/src/lib-index/mail-index.h	Tue May 22 20:11:01 2007 +0300
+++ b/src/lib-index/mail-index.h	Tue May 22 20:19:35 2007 +0300
@@ -189,9 +189,13 @@
 void mail_index_transaction_rollback(struct mail_index_transaction **t);
 /* Discard all changes in the transaction. */
 void mail_index_transaction_reset(struct mail_index_transaction *t);
+
 /* Returns the view transaction was created for. */
 struct mail_index_view *
 mail_index_transaction_get_view(struct mail_index_transaction *t);
+/* Returns TRUE if the given sequence is being expunged in this transaction. */
+bool mail_index_transaction_is_expunged(struct mail_index_transaction *t,
+					uint32_t seq);
 
 /* Returns a view to transaction. Currently this differs from normal view only
    in that it contains newly appended messages in transaction. The view can