From: Timo Sirainen Date: Sat, 14 Jan 2017 14:12:56 +0000 (+0200) Subject: lib-storage: Add struct mail_user.namespaces_created X-Git-Tag: 2.3.0.rc1~2309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71bfb0ac64babaa2c15457492227f0ba3adce307;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Add struct mail_user.namespaces_created This makes it easier to determine in mail_namespaces_added hook if the namespaces being added are the initial ones or later ones. --- diff --git a/src/lib-storage/mail-namespace.c b/src/lib-storage/mail-namespace.c index 9ae113d3a9..c1a8f68eef 100644 --- a/src/lib-storage/mail-namespace.c +++ b/src/lib-storage/mail-namespace.c @@ -390,6 +390,7 @@ int mail_namespaces_init_finish(struct mail_namespace *namespaces, *error_r = t_strdup(namespaces->user->error); return -1; } + namespaces->user->namespaces_created = TRUE; return 0; } diff --git a/src/lib-storage/mail-user.h b/src/lib-storage/mail-user.h index 131860a6a2..8ae20ea225 100644 --- a/src/lib-storage/mail-user.h +++ b/src/lib-storage/mail-user.h @@ -72,6 +72,9 @@ struct mail_user { bool autocreated:1; /* mail_user_init() has been called */ bool initialized:1; + /* The initial namespaces have been created and + hook_mail_namespaces_created() has been called. */ + bool namespaces_created:1; /* SET_STR_VARS in user's all settings have been expanded. This happens near the beginning of the user initialization, so this is rarely needed to be checked. */