# HG changeset patch # User Waqas Hussain # Date 1245899465 -18000 # Node ID e34cbd9baf8ba94cfd41710cc5358e25b304f904 # Parent 9b745496b953056ab9aab7504938ee5606fdc3c4 stanza_router: Remove some more old routing code diff -r 9b745496b953 -r e34cbd9baf8b core/stanza_router.lua --- a/core/stanza_router.lua Thu Jun 25 08:04:10 2009 +0500 +++ b/core/stanza_router.lua Thu Jun 25 08:11:05 2009 +0500 @@ -164,22 +164,11 @@ else if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing end - end - - if host and fire_event(host.."/"..stanza.name, event_data) then - -- event handled - elseif stanza.name == "presence" and origin.host and fire_event(origin.host.."/"..stanza.name, event_data) then - -- event handled - elseif not to then - modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); - elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server - modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); - elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server - component_handle_stanza(origin, stanza); - elseif hosts[host] and hosts[host].type == "component" then -- directed at a component - component_handle_stanza(origin, stanza); - elseif hosts[host] and hosts[host].type == "local" and stanza.name == "iq" and not resource then -- directed at bare JID - modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza); + if not modules_handle_stanza(h.host, origin, stanza) then + if stanza.attr.xmlns == "jabber:client" and stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); + end + end else core_route_stanza(origin, stanza); end