From 0753c5271036de8fed24f1a6707080af4455f357 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 26 Jul 2003 19:54:29 +0300 Subject: [PATCH] Added hook_client_created and hook_mail_storage_created for modules. --HG-- branch : HEAD --- src/imap/client.c | 3 +++ src/imap/common.h | 3 +++ src/imap/main.c | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/imap/client.c b/src/imap/client.c index 98baef3563..ee3ef354f0 100644 --- a/src/imap/client.c +++ b/src/imap/client.c @@ -70,6 +70,9 @@ struct client *client_create(int hin, int hout, struct mail_storage *storage) i_assert(my_client == NULL); my_client = client; + + if (hook_client_created != NULL) + hook_client_created(client); return client; } diff --git a/src/imap/common.h b/src/imap/common.h index 667716e115..817d3417b9 100644 --- a/src/imap/common.h +++ b/src/imap/common.h @@ -21,4 +21,7 @@ extern enum mailbox_open_flags mailbox_open_flags; extern string_t *capability_string; +extern void (*hook_mail_storage_created)(struct mail_storage *storage); +extern void (*hook_client_created)(struct client *client); + #endif diff --git a/src/imap/main.c b/src/imap/main.c index a9be7d701a..3704e89488 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -29,6 +29,9 @@ enum mailbox_open_flags mailbox_open_flags; static struct module *modules; static char log_prefix[128]; /* syslog() needs this to be permanent */ +void (*hook_mail_storage_created)(struct mail_storage *storage) = NULL; +void (*hook_client_created)(struct client *client) = NULL; + string_t *capability_string; static void sig_quit(int signo __attr_unused__) @@ -134,6 +137,9 @@ static void main_init(void) } } + if (hook_mail_storage_created != NULL) + hook_mail_storage_created(storage); + str = getenv("IMAP_MAX_LINE_LENGTH"); imap_max_line_length = str != NULL ? (unsigned int)strtoul(str, NULL, 10) : -- 2.47.3