dovecot-2.0: lib-storage: Added mail_namespace_storage_added hook.
dovecot at dovecot.org
dovecot at dovecot.org
Mon Dec 14 21:40:21 EET 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/bc9dbd257811
changeset: 10483:bc9dbd257811
user: Timo Sirainen <tss at iki.fi>
date: Mon Dec 14 14:30:44 2009 -0500
description:
lib-storage: Added mail_namespace_storage_added hook.
diffstat:
3 files changed, 13 insertions(+)
src/lib-storage/mail-namespace.c | 1 +
src/lib-storage/mail-storage-hooks.c | 10 ++++++++++
src/lib-storage/mail-storage-hooks.h | 2 ++
diffs (50 lines):
diff -r 64a01185564b -r bc9dbd257811 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c Mon Dec 14 12:56:51 2009 -0500
+++ b/src/lib-storage/mail-namespace.c Mon Dec 14 14:30:44 2009 -0500
@@ -19,6 +19,7 @@ void mail_namespace_add_storage(struct m
if (storage->v.add_list != NULL)
storage->v.add_list(storage, ns->list);
+ hook_mail_namespace_storage_added(ns);
}
void mail_namespace_finish_list_init(struct mail_namespace *ns,
diff -r 64a01185564b -r bc9dbd257811 src/lib-storage/mail-storage-hooks.c
--- a/src/lib-storage/mail-storage-hooks.c Mon Dec 14 12:56:51 2009 -0500
+++ b/src/lib-storage/mail-storage-hooks.c Mon Dec 14 14:30:44 2009 -0500
@@ -131,6 +131,16 @@ void hook_mail_user_created(struct mail_
}
}
+void hook_mail_namespace_storage_added(struct mail_namespace *ns)
+{
+ const struct mail_storage_hooks *const *hooks;
+
+ array_foreach(&ns->user->hooks, hooks) {
+ if ((*hooks)->mail_namespace_storage_added != NULL)
+ (*hooks)->mail_namespace_storage_added(ns);
+ }
+}
+
void hook_mail_namespaces_created(struct mail_namespace *namespaces)
{
const struct mail_storage_hooks *const *hooks;
diff -r 64a01185564b -r bc9dbd257811 src/lib-storage/mail-storage-hooks.h
--- a/src/lib-storage/mail-storage-hooks.h Mon Dec 14 12:56:51 2009 -0500
+++ b/src/lib-storage/mail-storage-hooks.h Mon Dec 14 14:30:44 2009 -0500
@@ -10,6 +10,7 @@ struct mailbox;
struct mail_storage_hooks {
void (*mail_user_created)(struct mail_user *user);
+ void (*mail_namespace_storage_added)(struct mail_namespace *ns);
void (*mail_namespaces_created)(struct mail_namespace *namespaces);
void (*mail_storage_created)(struct mail_storage *storage);
void (*mailbox_list_created)(struct mailbox_list *list);
@@ -28,6 +29,7 @@ void mail_storage_hooks_remove_internal(
void mail_storage_hooks_remove_internal(const struct mail_storage_hooks *hooks);
void hook_mail_user_created(struct mail_user *user);
+void hook_mail_namespace_storage_added(struct mail_namespace *ns);
void hook_mail_namespaces_created(struct mail_namespace *namespaces);
void hook_mail_storage_created(struct mail_storage *storage);
void hook_mailbox_list_created(struct mailbox_list *list);
More information about the dovecot-cvs
mailing list