void notify_contexts_mail_transaction_commit(struct mailbox_transaction_context *t,
struct mail_transaction_commit_changes *changes);
void notify_contexts_mail_transaction_rollback(struct mailbox_transaction_context *t);
+void notify_contexts_mailbox_create(struct mailbox *box);
void notify_contexts_mailbox_delete_begin(struct mailbox *box);
void notify_contexts_mailbox_delete_commit(struct mailbox *box);
void notify_contexts_mailbox_delete_rollback(void);
}
}
+void notify_contexts_mailbox_create(struct mailbox *box)
+{
+ struct notify_context *ctx;
+
+ for (ctx = ctx_list; ctx != NULL; ctx = ctx->next) {
+ if (ctx->v.mailbox_create != NULL)
+ ctx->v.mailbox_create(box);
+ }
+}
+
void notify_contexts_mailbox_delete_begin(struct mailbox *box)
{
struct notify_context *ctx;
void (*mail_transaction_commit)(void *txn,
struct mail_transaction_commit_changes *changes);
void (*mail_transaction_rollback)(void *txn);
+ void (*mailbox_create)(struct mailbox *box);
void *(*mailbox_delete_begin)(struct mailbox *box);
void (*mailbox_delete_commit)(void *txn, struct mailbox *box);
void (*mailbox_delete_rollback)(void *txn);
bool rename_children);
};
+void notify_noop_mailbox_create(struct mailbox *box);
struct notify_context *
notify_register(const struct notify_vfuncs *vfuncs);
void notify_unregister(struct notify_context *ctx);
lbox->super.transaction_rollback(t);
}
+static int
+notify_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
+ bool directory)
+{
+ union mailbox_module_context *lbox = NOTIFY_CONTEXT(box);
+
+ if (lbox->super.create(box, update, directory) < 0)
+ return -1;
+
+ notify_contexts_mailbox_create(box);
+ return 0;
+}
+
static int
notify_mailbox_delete(struct mailbox *box)
{
v->transaction_begin = notify_transaction_begin;
v->transaction_commit = notify_transaction_commit;
v->transaction_rollback = notify_transaction_rollback;
+ v->create = notify_mailbox_create;
v->delete = notify_mailbox_delete;
v->rename = notify_mailbox_rename;
MODULE_CONTEXT_SET_SELF(box, notify_storage_module, lbox);