# HG changeset patch # User Waqas Hussain # Date 1289339496 -18000 # Node ID 78ed7ad330abd4cd4a284ec16ee1e54864424ea1 # Parent c8ce9923c315c874c4d28ceed81bdbc320ef40e4 componentmanager, stanza_router: Get rid of componentmanager.handle_stanza(). diff -r c8ce9923c315 -r 78ed7ad330ab core/componentmanager.lua --- a/core/componentmanager.lua Wed Nov 10 02:50:35 2010 +0500 +++ b/core/componentmanager.lua Wed Nov 10 02:51:36 2010 +0500 @@ -57,22 +57,6 @@ prosody.events.add_handler("server-starting", load_enabled_components); end -function handle_stanza(origin, stanza) - local node, host = jid_split(stanza.attr.to); - local component = nil; - 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]); - else - log("error", "Component manager recieved a stanza for a non-existing component: "..tostring(stanza)); - default_component_handler(origin, stanza); - end -end - function create_component(host, component, events) -- TODO check for host well-formedness return { type = "component", host = host, connected = true, s2sout = {}, diff -r c8ce9923c315 -r 78ed7ad330ab core/stanza_router.lua --- a/core/stanza_router.lua Wed Nov 10 02:50:35 2010 +0500 +++ b/core/stanza_router.lua Wed Nov 10 02:51:36 2010 +0500 @@ -12,7 +12,6 @@ local tostring = tostring; local st = require "util.stanza"; local send_s2s = require "core.s2smanager".send_to_host; -local component_handle_stanza = require "core.componentmanager".handle_stanza; local jid_split = require "util.jid".split; local jid_prepped_split = require "util.jid".prepped_split; @@ -172,11 +171,6 @@ if h then if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing if to_self and h.events.fire_event(stanza.name..'/self', event_data) then return; end -- do processing - - if h.type == "component" then - component_handle_stanza(origin, stanza); - return; - end handle_unhandled_stanza(h.host, origin, stanza); else core_route_stanza(origin, stanza);