]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added hook_client_created and hook_mail_storage_created for modules.
authorTimo Sirainen <tss@iki.fi>
Sat, 26 Jul 2003 16:54:29 +0000 (19:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 26 Jul 2003 16:54:29 +0000 (19:54 +0300)
--HG--
branch : HEAD

src/imap/client.c
src/imap/common.h
src/imap/main.c

index 98baef3563bcf6254b91a3a488f495889547504a..ee3ef354f03fc3007507920f2c9236b3bead265c 100644 (file)
@@ -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;
 }
 
index 667716e1157e61eac8d578b9c4fa393b30bcdc4b..817d3417b9a7499dac5291794132fb1df1462317 100644 (file)
@@ -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
index a9be7d701af085acdefd17ea23c7e751b3265b79..3704e89488ccd97379331743685f8a2518855ed8 100644 (file)
@@ -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) :