# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1721597272 -7200
# Node ID 04c60a3533316ecdd8d42faa7365cf2273d86d6b
# Parent  f9e40f5c6dafcd4a348c02a01e64bff839d53f4c
add configured namespaces to the dav context

diff -r f9e40f5c6daf -r 04c60a353331 dav/config.c
--- a/dav/config.c	Sun Jul 21 23:19:40 2024 +0200
+++ b/dav/config.c	Sun Jul 21 23:27:52 2024 +0200
@@ -156,6 +156,10 @@
         return 1;
     }
     
+    if(dav_config_register_namespaces(davconfig, ctx)) {
+        return 1;
+    }
+    
     return dav_config_register_keys(davconfig, ctx, load_key_file);
 }
 
diff -r f9e40f5c6daf -r 04c60a353331 libidav/config.c
--- a/libidav/config.c	Sun Jul 21 23:19:40 2024 +0200
+++ b/libidav/config.c	Sun Jul 21 23:27:52 2024 +0200
@@ -818,3 +818,12 @@
     }
     return 0;
 }
+
+int dav_config_register_namespaces(DavConfig *config, DavContext *ctx) {
+    DavCfgNamespace *ns = config->namespaces;
+    while(ns) {
+        dav_add_namespace(ctx, ns->prefix.ptr, ns->uri.ptr);
+        ns = ns->next;
+    }
+    return 0;
+}
diff -r f9e40f5c6daf -r 04c60a353331 libidav/config.h
--- a/libidav/config.h	Sun Jul 21 23:19:40 2024 +0200
+++ b/libidav/config.h	Sun Jul 21 23:27:52 2024 +0200
@@ -186,6 +186,8 @@
 int dav_config_keytype(DavCfgKeyType type);
 int dav_config_register_keys(DavConfig *config, DavContext *ctx, dav_loadkeyfile_func loadkey);
 
+int dav_config_register_namespaces(DavConfig *config, DavContext *ctx);
+
 #ifdef __cplusplus
 }
 #endif