Mercurial > prosody-hg
changeset 13919:6ad72bd9a7ec
Merge 13.0->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 27 Jul 2025 01:11:58 +0200 |
| parents | 598359d9f580 (current diff) f0d854c63c8d (diff) |
| children | 33755e085ca5 |
| files | |
| diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/core/configmanager.lua Fri Jul 25 20:33:38 2025 +0200 +++ b/core/configmanager.lua Sun Jul 27 01:11:58 2025 +0200 @@ -7,8 +7,8 @@ -- local _G = _G; -local setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs = - setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs; +local getmetatable, setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs = + getmetatable, setmetatable, rawget, rawset, io, os, error, dofile, type, pairs, ipairs; local format, math_max, t_insert = string.format, math.max, table.insert; local envload = require"prosody.util.envload".envload; @@ -169,6 +169,9 @@ error("Invalid syntax - missing '=' perhaps?", 2); end; }; + local function is_config_option_proxy(v) + return getmetatable(v) == config_option_proxy_mt; + end -- For reading config values out of files. local function filereader(basepath, defaultmode) @@ -262,6 +265,9 @@ t_insert(warnings, ("%s:%d: Duplicate option '%s'"):format(config_file, get_line_number(config_file), k)); end set_options[option_path] = true; + if is_config_option_proxy(v) then + setmetatable(v, nil); + end set(config_table, env.__currenthost or "*", k, v); end });
