diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_console.lua | 13 | ||||
-rw-r--r-- | plugins/mod_muc.lua | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 3248ca8c..28e12a62 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -160,7 +160,8 @@ end -- Anything in def_env will be accessible within the session as a global variable def_env.server = {}; -function def_env.server:reload() + +function def_env.server:insane_reload() prosody.unlock_globals(); dofile "prosody" prosody = _G.prosody; @@ -185,6 +186,11 @@ function def_env.server:uptime() minutes, (minutes ~= 1 and "s") or "", os.date("%c", prosody.start_time)); end +function def_env.server:shutdown(reason) + prosody.shutdown(reason); + return true, "Shutdown initiated"; +end + def_env.module = {}; local function get_hosts_set(hosts, module) @@ -288,6 +294,11 @@ function def_env.config:get(host, section, key) return true, tostring(config_get(host, section, key)); end +function def_env.config:reload() + local ok, err = prosody.reload_config(); + return ok, (ok and "Config reloaded (you may need to reload modules to take effect)") or tostring(err); +end + def_env.hosts = {}; function def_env.hosts:list() for host, host_session in pairs(hosts) do diff --git a/plugins/mod_muc.lua b/plugins/mod_muc.lua index e99ef83c..b38468ea 100644 --- a/plugins/mod_muc.lua +++ b/plugins/mod_muc.lua @@ -76,6 +76,8 @@ component = register_component(muc_host, function(origin, stanza) handle_to_domain(origin, stanza); end); +prosody.hosts[module:get_host()].muc = { rooms = rooms }; + module.unload = function() deregister_component(muc_host); end @@ -84,4 +86,5 @@ module.save = function() end module.restore = function(data) rooms = data.rooms or {}; + prosody.hosts[module:get_host()].muc = { rooms = rooms }; end |