From 8f1d14e3ada93a6d6ee64f73c6e6ae2364d8eba1 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 26 Jul 2003 21:29:02 +0300 Subject: [PATCH] Added pop3 hooks --HG-- branch : HEAD --- src/pop3/client.c | 2 ++ src/pop3/common.h | 3 +++ src/pop3/main.c | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/pop3/client.c b/src/pop3/client.c index b30bf94b3f..bd8b79e6e7 100644 --- a/src/pop3/client.c +++ b/src/pop3/client.c @@ -139,6 +139,8 @@ 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/pop3/common.h b/src/pop3/common.h index ed12ccaf18..04f40d14e4 100644 --- a/src/pop3/common.h +++ b/src/pop3/common.h @@ -10,4 +10,7 @@ extern struct ioloop *ioloop; +extern void (*hook_mail_storage_created)(struct mail_storage **storage); +extern void (*hook_client_created)(struct client **client); + #endif diff --git a/src/pop3/main.c b/src/pop3/main.c index ba340ab868..31b27b0127 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -18,6 +18,9 @@ struct ioloop *ioloop; +void (*hook_mail_storage_created)(struct mail_storage **storage) = NULL; +void (*hook_client_created)(struct client **client) = NULL; + static struct module *modules; static char log_prefix[128]; /* syslog() needs this to be permanent */ @@ -104,6 +107,9 @@ static int main_init(void) } } + if (hook_mail_storage_created != NULL) + hook_mail_storage_created(&storage); + return client_create(0, 1, storage) != NULL; } -- 2.47.3