aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-02-05 01:33:46 +0100
committerKim Alvefur <zash@zash.se>2022-02-05 01:33:46 +0100
commit8648dd2191216375947d7dbb62ed8432c59a1e14 (patch)
tree4ab402bc4139cc33902718e5f731b1b97db49a80
parent69a91952430724e285ac593468f6d65d76f23c2c (diff)
downloadprosody-8648dd2191216375947d7dbb62ed8432c59a1e14.tar.gz
prosody-8648dd2191216375947d7dbb62ed8432c59a1e14.zip
core.modulemanager: Save module metadata for potential later use
Makes it reachable from the shell if nothing else
-rw-r--r--core/modulemanager.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 3bf571ad..b66f3944 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -219,7 +219,7 @@ local function do_load_module(host, module_name, state)
local pluginenv = setmetatable({ module = api_instance }, { __index = _G });
api_instance.environment = pluginenv;
- local mod, err = loader:load_code(module_name, nil, pluginenv);
+ local mod, err, meta = loader:load_code(module_name, nil, pluginenv);
if not mod then
log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
api_instance:set_status("error", "Failed to load (see log)");
@@ -227,6 +227,7 @@ local function do_load_module(host, module_name, state)
end
api_instance.path = err;
+ api_instance.meta = meta;
local custom_plugins = prosody.paths.installer;
if custom_plugins and err:sub(1, #custom_plugins+1) == custom_plugins.."/" then