return view->index;
}
-unsigned int
-mail_index_view_get_transaction_count(struct mail_index_view *view)
+bool mail_index_view_have_transactions(struct mail_index_view *view)
{
i_assert(view->transactions >= 0);
- return view->transactions;
+ return view->transactions > 0;
}
void mail_index_view_transaction_ref(struct mail_index_view *view)
uint32_t mail_index_view_get_messages_count(struct mail_index_view *view);
/* Returns TRUE if we lost track of changes for some reason. */
bool mail_index_view_is_inconsistent(struct mail_index_view *view);
-/* Returns number of transactions open for the view. */
-unsigned int
-mail_index_view_get_transaction_count(struct mail_index_view *view);
+/* Returns TRUE if there are open transactions open for the view. */
+bool mail_index_view_have_transactions(struct mail_index_view *view);
/* Transaction has to be opened to be able to modify index. You can have
multiple transactions open simultaneously. Committed transactions won't
mail_storage_set_index_error(MAP_STORAGE(map), map->index);
return -1;
}
- if (mail_index_view_get_transaction_count(map->view) > 0) {
+ if (mail_index_view_have_transactions(map->view)) {
/* can't sync when there are transactions */
return 0;
}