]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Remove mail_namespace.user_set
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 20 Jan 2023 01:23:50 +0000 (03:23 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:20:55 +0000 (14:20 +0200)
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.

src/lib-storage/index/shared/shared-storage.c
src/lib-storage/mail-namespace.c
src/lib-storage/mail-namespace.h

index a31086667694c2e6bea0bd55d2fe0cd3370f5f4c..7a3f9dc9ccce15041bc34ec608a12b3cf294fea0 100644 (file)
@@ -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);
 
index 1b73b30e44e2a35930e129cc92a8400140561dff..915257bf8b03d1730a22e6a548c8d50c4ee1c0f3 100644 (file)
@@ -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;
index 9c0c6cd289ab80f6436a18893233ca57d6f3b200..0f9bd719b84c6f3808de1e2dad7a4578dc2e3ad0 100644 (file)
@@ -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);