]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add struct mail_user.namespaces_created
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 14 Jan 2017 14:12:56 +0000 (16:12 +0200)
committerGitLab <gitlab@git.dovecot.net>
Sun, 15 Jan 2017 17:24:06 +0000 (19:24 +0200)
This makes it easier to determine in mail_namespaces_added hook if the
namespaces being added are the initial ones or later ones.

src/lib-storage/mail-namespace.c
src/lib-storage/mail-user.h

index 9ae113d3a9a847ee2589ec181d70c08cc1fcb0c3..c1a8f68eef02de032c78b9f8143a55b589ac75a1 100644 (file)
@@ -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;
 }
 
index 131860a6a243473e044e287f9bdcc2905e297f45..8ae20ea225ce60f7ffaf3af8ad258e1393518b82 100644 (file)
@@ -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. */