]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add mailbox_sync_notify()
authorSiavash Tavakoli <siavash.tavakoli@open-xchange.com>
Mon, 29 Mar 2021 12:41:32 +0000 (13:41 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 15 Apr 2021 07:06:27 +0000 (07:06 +0000)
Instead of calling sync_notify vfunc directly everywhere.

src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c

index d08c86ec2fb15f4700246d38db5105d809190ad5..dc035a851c683bea6725893d630d6c8b61386bee 100644 (file)
@@ -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);
 
index 2bfe183537c011039df65f02470e2d84f2e99174..a67ef34ea18c19ef9c844d302bb5b627b497a190 100644 (file)
@@ -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);
+}