Diff

core/componentmanager.lua @ 1774:53bd9c9f3103

ComponentManager: Removed dependency on core_route_stanza. The default component handler now replies using origin.send().
author Waqas Hussain <waqas20@gmail.com>
date Fri, 11 Sep 2009 16:28:52 +0500
parent 1773:f47aa1d336b5
child 1775:5c035b7a6de1
line wrap: on
line diff
--- 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