diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-02-11 18:30:44 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-02-11 18:30:44 +0000 |
commit | 593f1c0a523ef586f3884057632eae8123066209 (patch) | |
tree | b2b1a6350c4204f01039e31d234bf573c2ec31e7 /core/componentmanager.lua | |
parent | 0a8bd35cebf8ee3772e1f9acd5740aea8db65d25 (diff) | |
parent | 5833e92990f5035f3b4b2c8f7c3c0651b28aa23f (diff) | |
download | prosody-593f1c0a523ef586f3884057632eae8123066209.tar.gz prosody-593f1c0a523ef586f3884057632eae8123066209.zip |
Merge with waqas for MUC/routing fixes
Diffstat (limited to 'core/componentmanager.lua')
-rw-r--r-- | core/componentmanager.lua | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua index 0d61bbb1..04909a07 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -27,21 +27,13 @@ function load_enabled_components(config) for host, host_config in pairs(defined_hosts) do if host ~= "*" and ((host_config.core.enabled == nil or host_config.core.enabled) and type(host_config.core.component_module) == "string") then - hosts[host] = { type = "component", host = host, connected = true, s2sout = {} }; - modulemanager.load(host, "dialback"); + hosts[host] = { type = "component", host = host, connected = false, s2sout = {} }; local ok, err = modulemanager.load(host, host_config.core.component_module); if not ok then log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(err)); else log("info", "Activated %s component: %s", host_config.core.component_module, host); end - - local ok, component_handler = modulemanager.call_module_method(modulemanager.get_module(host, host_config.core.component_module), "load_component"); - if not ok then - log("error", "Error loading %s component %s: %s", tostring(host_config.core.component_module), tostring(host), tostring(component_handler)); - else - components[host] = component_handler; - end end end end @@ -63,7 +55,7 @@ function handle_stanza(origin, stanza) end
function register_component(host, component)
- if not hosts[host] then
+ if not hosts[host] or (hosts[host].type == 'component' and not hosts[host].connected) then
-- TODO check for host well-formedness
components[host] = component;
hosts[host] = { type = "component", host = host, connected = true, s2sout = {} }; |