# HG changeset patch # User Waqas Hussain # Date 1252668532 -18000 # Node ID 53bd9c9f310310fc5dfeb891ef5b6552ea287ab5 # Parent f47aa1d336b5d607822f7abfd549e28968d7c4f3 ComponentManager: Removed dependency on core_route_stanza. The default component handler now replies using origin.send(). diff -r f47aa1d336b5 -r 53bd9c9f3103 core/componentmanager.lua --- a/core/componentmanager.lua Fri Sep 11 16:20:49 2009 +0500 +++ b/core/componentmanager.lua Fri Sep 11 16:28:52 2009 +0500 @@ -10,7 +10,6 @@ local log = require "util.logger".init("componentmanager"); local configmanager = require "core.configmanager"; local modulemanager = require "core.modulemanager"; -local core_route_stanza = core_route_stanza; local jid_split = require "util.jid".split; local events_new = require "util.events".new; local st = require "util.stanza"; @@ -23,14 +22,12 @@ local disco_items = require "util.multitable".new(); local NULL = {}; -prosody.events.add_handler("server-starting", function () core_route_stanza = _G.core_route_stanza; end); - module "componentmanager" local function default_component_handler(origin, stanza) log("warn", "Stanza being handled by default component, bouncing error"); if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then - core_route_stanza(nil, st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); + origin.send(st.error_reply(stanza, "wait", "service-unavailable", "Component unavailable")); end end