Skip to content

Commit

Permalink
lib-storage: Add struct mail_user.namespaces_created
Browse files Browse the repository at this point in the history
This makes it easier to determine in mail_namespaces_added hook if the
namespaces being added are the initial ones or later ones.
  • Loading branch information
sirainen committed Jan 15, 2017
1 parent fffd49c commit 23c8b18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib-storage/mail-namespace.c
Expand Up @@ -388,6 +388,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;
}

Expand Down
3 changes: 3 additions & 0 deletions src/lib-storage/mail-user.h
Expand Up @@ -72,6 +72,9 @@ struct mail_user {
unsigned int autocreated:1;
/* mail_user_init() has been called */
unsigned int initialized:1;
/* The initial namespaces have been created and
hook_mail_namespaces_created() has been called. */
unsigned int 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. */
Expand Down

0 comments on commit 23c8b18

Please sign in to comment.