aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_console.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-27 23:36:17 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-27 23:36:17 +0000
commitf588a0f5b0dd4c6b6d2c81a517594b50b45fc15b (patch)
tree7f5351ed0a7f95c8f292c92c31b7ff16fee858f1 /plugins/mod_console.lua
parente6297e237d1407a5a5cf83f312cfbea1e2371e6e (diff)
downloadprosody-f588a0f5b0dd4c6b6d2c81a517594b50b45fc15b.tar.gz
prosody-f588a0f5b0dd4c6b6d2c81a517594b50b45fc15b.zip
Add module:unload() to mod_console, and allow module:load() to take config param
Diffstat (limited to 'plugins/mod_console.lua')
-rw-r--r--plugins/mod_console.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua
index 8b123df4..b1dc263c 100644
--- a/plugins/mod_console.lua
+++ b/plugins/mod_console.lua
@@ -129,15 +129,24 @@ function def_env.server:reload()
end
def_env.module = {};
-function def_env.module:load(name, host)
+function def_env.module:load(name, host, config)
local mm = require "modulemanager";
- local ok, err = mm.load(host or self.env.host, name);
+ local ok, err = mm.load(host or self.env.host, name, config);
if not ok then
return false, err or "Unknown error loading module";
end
return true, "Module loaded";
end
+function def_env.module:unload(name, host)
+ local mm = require "modulemanager";
+ local ok, err = mm.unload(host or self.env.host, name);
+ if not ok then
+ return false, err or "Unknown error unloading module";
+ end
+ return true, "Module unloaded";
+end
+
def_env.config = {};
function def_env.config:load(filename, format)
local config_load = require "core.configmanager".load;