29 |
29 |
30 module "componentmanager" |
30 module "componentmanager" |
31 |
31 |
32 function handle_stanza(origin, stanza) |
32 function handle_stanza(origin, stanza) |
33 local node, host = jid_split(stanza.attr.to); |
33 local node, host = jid_split(stanza.attr.to); |
34 local component = components[host]; |
34 local component = nil; |
|
35 if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource |
35 if not component then component = components[node.."@"..host]; end -- hack to allow hooking node@server |
36 if not component then component = components[node.."@"..host]; end -- hack to allow hooking node@server |
36 if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource |
37 if not component then component = components[host]; end |
37 if component then |
38 if component then |
38 log("debug", "stanza being handled by component: "..host); |
39 log("debug", "stanza being handled by component: "..host); |
39 component(origin, stanza, hosts[host]); |
40 component(origin, stanza, hosts[host]); |
40 else |
41 else |
41 log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to); |
42 log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to); |