Comparison

core/componentmanager.lua @ 1177:97ecfcec2d71

componentmanager: Don't error on stanzas to bare component JID
author Matthew Wild <mwild1@gmail.com>
date Sat, 16 May 2009 18:23:54 +0100
parent 1168:dd523bfc9ea9
child 1188:fa48e69c4786
comparison
equal deleted inserted replaced
1176:2be14b7021b2 1177:97ecfcec2d71
65 eventmanager.add_event_hook("server-starting", load_enabled_components); 65 eventmanager.add_event_hook("server-starting", load_enabled_components);
66 66
67 function handle_stanza(origin, stanza) 67 function handle_stanza(origin, stanza)
68 local node, host = jid_split(stanza.attr.to); 68 local node, host = jid_split(stanza.attr.to);
69 local component = nil; 69 local component = nil;
70 if not component then component = components[node.."@"..host]; end -- hack to allow hooking node@server 70 if host then
71 if not component then component = components[host]; end 71 if node then component = components[node.."@"..host]; end -- hack to allow hooking node@server
72 if not component then component = components[host]; end
73 end
72 if component then 74 if component then
73 log("debug", "%s stanza being handled by component: %s", stanza.name, host); 75 log("debug", "%s stanza being handled by component: %s", stanza.name, host);
74 component(origin, stanza, hosts[host]); 76 component(origin, stanza, hosts[host]);
75 else 77 else
76 log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to); 78 log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to);