Mercurial > dovecot > core-2.2
changeset 11646:b2aca3e50f44 HEAD
lib-index: Added mail_index_sync_has_expunges()
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 28 Jun 2010 16:31:39 +0100 |
parents | f4238836c566 |
children | 612df9b3df83 |
files | src/lib-index/mail-index-sync.c src/lib-index/mail-index.h |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync.c Mon Jun 28 16:25:35 2010 +0100 +++ b/src/lib-index/mail-index-sync.c Mon Jun 28 16:31:39 2010 +0100 @@ -496,6 +496,12 @@ return 1; } +bool mail_index_sync_has_expunges(struct mail_index_sync_ctx *ctx) +{ + return array_is_created(&ctx->sync_trans->expunges) && + array_count(&ctx->sync_trans->expunges) > 0; +} + static bool mail_index_sync_view_have_any(struct mail_index_view *view, enum mail_index_sync_flags flags) {
--- a/src/lib-index/mail-index.h Mon Jun 28 16:25:35 2010 +0100 +++ b/src/lib-index/mail-index.h Mon Jun 28 16:31:39 2010 +0100 @@ -340,6 +340,8 @@ struct mail_index_sync_rec *sync_rec); /* Returns TRUE if there's more to sync. */ bool mail_index_sync_have_more(struct mail_index_sync_ctx *ctx); +/* Returns TRUE if sync has any expunges to handle. */ +bool mail_index_sync_has_expunges(struct mail_index_sync_ctx *ctx); /* Reset syncing to initial state after mail_index_sync_begin(), so you can go through all the sync records again with mail_index_sync_next(). */ void mail_index_sync_reset(struct mail_index_sync_ctx *ctx);