aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua11
1 files changed, 3 insertions, 8 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 601c00d9..d6220cec 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -18,6 +18,7 @@ local config = require "core.configmanager";
local multitable_new = require "util.multitable".new;
local register_actions = require "core.actions".register;
local st = require "util.stanza";
+local pluginloader = require "util.pluginloader";
local hosts = hosts;
local prosody = prosody;
@@ -113,7 +114,7 @@ function load(host, module_name, config)
end
- local mod, err = loadfile(get_module_filename(module_name));
+ local mod, err = pluginloader.load_code(module_name);
if not mod then
log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
return nil, err;
@@ -187,7 +188,7 @@ function reload(host, name, ...)
local mod = get_module(host, name);
if not mod then return nil, "module-not-loaded"; end
- local _mod, err = loadfile(get_module_filename(name)); -- checking for syntax errors
+ local _mod, err = pluginloader.load_code(name); -- checking for syntax errors
if not _mod then
log("error", "Unable to load module '%s': %s", module_name or "nil", err or "nil");
return nil, err;
@@ -267,12 +268,6 @@ function call_module_method(module, method, ...)
end
end
-local _modulepath = { plugin_dir, "mod_", nil, ".lua"};
-function get_module_filename(name)
- _modulepath[3] = name;
- return t_concat(_modulepath);
-end
-
----- API functions exposed to modules -----------
-- Must all be in api.*