From: Siavash Tavakoli Date: Mon, 29 Mar 2021 12:41:32 +0000 (+0100) Subject: lib-storage: Add mailbox_sync_notify() X-Git-Tag: 2.3.15~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f9b9731e66166b1311adc3a4637a05d92bf7bd0;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Add mailbox_sync_notify() Instead of calling sync_notify vfunc directly everywhere. --- diff --git a/src/lib-storage/mail-storage-private.h b/src/lib-storage/mail-storage-private.h index d08c86ec2f..dc035a851c 100644 --- a/src/lib-storage/mail-storage-private.h +++ b/src/lib-storage/mail-storage-private.h @@ -858,6 +858,10 @@ enum mail_index_open_flags mail_storage_settings_to_index_flags(const struct mail_storage_settings *set); void mailbox_save_context_deinit(struct mail_save_context *ctx); +/* Notify that a sync should be done. */ +void mailbox_sync_notify(struct mailbox *box, uint32_t uid, + enum mailbox_sync_type sync_type); + /* for unit testing */ int mailbox_verify_name(struct mailbox *box); diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 2bfe183537..a67ef34ea1 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -3173,3 +3173,10 @@ int mailbox_lock_file_create(struct mailbox *box, const char *lock_fname, return mail_storage_lock_create(lock_path, &set, box->storage->set, lock_r, error_r); } + +void mailbox_sync_notify(struct mailbox *box, uint32_t uid, + enum mailbox_sync_type sync_type) +{ + if (box->v.sync_notify != NULL) + box->v.sync_notify(box, uid, sync_type); +}