From: Timo Sirainen Date: Fri, 20 Jan 2023 01:23:50 +0000 (+0200) Subject: lib-storage: Remove mail_namespace.user_set X-Git-Tag: 2.4.0~2279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3882893ecdb115c656369c4f56473b652d3b9e7e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Remove mail_namespace.user_set The idea was at some point to allow namespaces to override some settings. This wasn't actually used currently, and following changes will make this method obsolete. --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index a310866676..7a3f9dc9cc 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -348,7 +348,6 @@ shared_mail_user_init(struct mail_storage *_storage, new_ns->flags = (NAMESPACE_FLAG_SUBSCRIPTIONS & ns->flags) | NAMESPACE_FLAG_LIST_PREFIX | NAMESPACE_FLAG_HIDDEN | NAMESPACE_FLAG_AUTOCREATED | NAMESPACE_FLAG_INBOX_ANY; - new_ns->user_set = user->set; new_ns->mail_set = _storage->set; i_array_init(&new_ns->all_storages, 2); diff --git a/src/lib-storage/mail-namespace.c b/src/lib-storage/mail-namespace.c index 1b73b30e44..915257bf8b 100644 --- a/src/lib-storage/mail-namespace.c +++ b/src/lib-storage/mail-namespace.c @@ -83,7 +83,6 @@ namespace_has_special_use_mailboxes(struct mail_namespace_settings *ns_set) } int mail_namespace_alloc(struct mail_user *user, - void *user_all_settings, struct mail_namespace_settings *ns_set, struct mail_namespace **ns_r, const char **error_r) @@ -95,7 +94,6 @@ int mail_namespace_alloc(struct mail_user *user, ns->user = user; ns->prefix = i_strdup(ns_set->prefix); ns->set = ns_set; - ns->user_set = user_all_settings; ns->mail_set = settings_parser_get_root_set(user->set_parser, &mail_storage_setting_parser_info); i_array_init(&ns->all_storages, 2); @@ -162,8 +160,7 @@ int mail_namespaces_init_add(struct mail_user *user, ns_set->list, ns_set->subscriptions ? "yes" : "no", ns_set->location); - if ((ret = mail_namespace_alloc(user, user->set, - ns_set, &ns, error_r)) < 0) + if ((ret = mail_namespace_alloc(user, ns_set, &ns, error_r)) < 0) return ret; if (ns_set == &prefixless_ns_set) { @@ -531,8 +528,7 @@ int mail_namespaces_init_location(struct mail_user *user, const char *location, inbox_set->location, NULL); } - if ((ret = mail_namespace_alloc(user, user->set, - inbox_set, &ns, error_r)) < 0) + if ((ret = mail_namespace_alloc(user, inbox_set, &ns, error_r)) < 0) return ret; if (mail_storage_create(ns, driver, 0, &error) < 0) { @@ -561,7 +557,6 @@ struct mail_namespace *mail_namespaces_init_empty(struct mail_user *user) ns->prefix = i_strdup(""); ns->flags = NAMESPACE_FLAG_INBOX_USER | NAMESPACE_FLAG_INBOX_ANY | NAMESPACE_FLAG_LIST_PREFIX | NAMESPACE_FLAG_SUBSCRIPTIONS; - ns->user_set = user->set; ns->mail_set = mail_user_set_get_storage_set(user); i_array_init(&ns->all_storages, 2); return ns; diff --git a/src/lib-storage/mail-namespace.h b/src/lib-storage/mail-namespace.h index 9c0c6cd289..0f9bd719b8 100644 --- a/src/lib-storage/mail-namespace.h +++ b/src/lib-storage/mail-namespace.h @@ -70,12 +70,6 @@ struct mail_namespace { struct mail_storage *storage; /* default storage */ ARRAY(struct mail_storage *) all_storages; - /* This may point to user->set, but it may also point to - namespace-specific settings. When accessing namespace-specific - settings it should be done through here instead of through the - mail_user. */ - struct mail_user_settings *user_set; - const struct mail_namespace_settings *set; const struct mail_storage_settings *mail_set; @@ -92,15 +86,8 @@ static inline bool mail_namespace_is_removable(const struct mail_namespace *ns) /* Allocate a new namespace, and fill it based on the passed in settings. This is the most low-level namespace creation function. The storage isn't - initialized for the namespace. - - user_all_settings normally points to user->set. If you want to override - settings for the created namespace, you can duplicate the user's settings - and provide a pointer to it here. Note that the pointer must contain - ALL the settings, including the dynamic driver-specific settings, so it - needs to created via settings-parser API. */ + initialized for the namespace. */ int mail_namespace_alloc(struct mail_user *user, - void *user_all_settings, struct mail_namespace_settings *ns_set, struct mail_namespace **ns_r, const char **error_r);