]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Move mailbox_get_name_without_prefix()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 7 Mar 2025 10:26:39 +0000 (12:26 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Mar 2025 13:01:57 +0000 (13:01 +0000)
src/lib-storage/mail-storage.c

index 70cf532a13f4efe3603719420d41cfeed1ddcba9..b172440fec4e8f0945d81cf60281aca3ed5667cc 100644 (file)
@@ -66,6 +66,22 @@ ARRAY_TYPE(mail_storage) mail_storage_classes;
 
 static int mail_storage_init_refcount = 0;
 
+static const char *
+mailbox_get_name_without_prefix(struct mail_namespace *ns,
+                               const char *vname)
+{
+       if (ns->prefix_len > 0 &&
+           strncmp(ns->prefix, vname, ns->prefix_len-1) == 0) {
+               if (vname[ns->prefix_len-1] == mail_namespace_get_sep(ns))
+                       vname += ns->prefix_len;
+               else if (vname[ns->prefix_len-1] == '\0') {
+                       /* namespace prefix itself */
+                       vname = "";
+               }
+       }
+       return vname;
+}
+
 void mail_storage_init(void)
 {
        if (mail_storage_init_refcount++ > 0)
@@ -3463,22 +3479,6 @@ mail_storage_settings_to_index_flags(const struct mail_storage_settings *set)
        return index_flags;
 }
 
-static const char *
-mailbox_get_name_without_prefix(struct mail_namespace *ns,
-                               const char *vname)
-{
-       if (ns->prefix_len > 0 &&
-           strncmp(ns->prefix, vname, ns->prefix_len-1) == 0) {
-               if (vname[ns->prefix_len-1] == mail_namespace_get_sep(ns))
-                       vname += ns->prefix_len;
-               else if (vname[ns->prefix_len-1] == '\0') {
-                       /* namespace prefix itself */
-                       vname = "";
-               }
-       }
-       return vname;
-}
-
 static void mailbox_settings_filters_add(struct event *event,
                                         struct mailbox_list *list,
                                         const char *vname)