aboutsummaryrefslogtreecommitdiffstats
path: root/core/componentmanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-11 22:25:32 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-11 22:25:32 +0100
commite9441f6999f144cb1c4ff21dad58cf612257d35c (patch)
tree27181ea45cba4664355308456dca32bce339214c /core/componentmanager.lua
parent69787cdf52f151855434853740fb87291759947c (diff)
downloadprosody-e9441f6999f144cb1c4ff21dad58cf612257d35c.tar.gz
prosody-e9441f6999f144cb1c4ff21dad58cf612257d35c.zip
componentmanager: Restore default component when unregistering
Diffstat (limited to 'core/componentmanager.lua')
-rw-r--r--core/componentmanager.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua
index feae96dc..a6b253db 100644
--- a/core/componentmanager.lua
+++ b/core/componentmanager.lua
@@ -102,13 +102,14 @@ end
function deregister_component(host)
if components[host] then
modulemanager.unload(host, "dialback");
- components[host] = nil;
- local host_config = defined_hosts[host];
- if ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then
+ local host_config = configmanager.getconfig()[host];
+ if host_config and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then
-- Set default handler
+ components[host] = default_component_handler;
else
-- Component not in config, or disabled, remove
hosts[host] = nil;
+ components[host] = nil;
end
-- remove from disco_items
if not(host:find("@", 1, true) or host:find("/", 1, true)) and host:find(".", 1, true) then