Software /
code /
prosody
Diff
plugins/mod_console.lua @ 444:77485b9b840c
Add module:unload() to mod_console, and allow module:load() to take config param
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 27 Nov 2008 23:36:17 +0000 |
parent | 440:dee02bf4656a |
child | 461:8e66201f566a |
line wrap: on
line diff
--- a/plugins/mod_console.lua Thu Nov 27 17:12:05 2008 +0000 +++ b/plugins/mod_console.lua Thu Nov 27 23:36:17 2008 +0000 @@ -129,15 +129,24 @@ 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;