diff options
Diffstat (limited to 'core/componentmanager.lua')
-rw-r--r-- | core/componentmanager.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/componentmanager.lua b/core/componentmanager.lua index 93e2ae7b..2053bff4 100644 --- a/core/componentmanager.lua +++ b/core/componentmanager.lua @@ -67,9 +67,10 @@ eventmanager.add_event_hook("server-starting", load_enabled_components); function handle_stanza(origin, stanza) local node, host = jid_split(stanza.attr.to); local component = nil; - if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource - if not component then component = components[node.."@"..host]; end -- hack to allow hooking node@server - if not component then component = components[host]; end + if host then + if node then component = components[node.."@"..host]; end -- hack to allow hooking node@server + if not component then component = components[host]; end + end if component then log("debug", "%s stanza being handled by component: %s", stanza.name, host); component(origin, stanza, hosts[host]); @@ -80,8 +81,7 @@ end function create_component(host, component) -- TODO check for host well-formedness - local session = session or { type = "component", host = host, connected = true, s2sout = {} }; - return session; + return { type = "component", host = host, connected = true, s2sout = {} }; end function register_component(host, component, session) |