stanza_router: Fire events also for stanzas to components

Fri, 26 Jun 2009 05:54:03 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 26 Jun 2009 05:54:03 +0100
changeset 1419
1ac8bcc63a9d
parent 1418
d14de6cb8b5b
child 1420
1576a5aa52f8

stanza_router: Fire events also for stanzas to components

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Fri Jun 26 08:54:22 2009 +0500
+++ b/core/stanza_router.lua	Fri Jun 26 05:54:03 2009 +0100
@@ -144,11 +144,11 @@
 	end
 	local h = hosts[to_bare] or hosts[host or origin.host];
 	if h then
+		if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing
+
 		if h.type == "component" then
 			component_handle_stanza(origin, stanza);
 			return;
-		else
-			if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing
 		end
 		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

mercurial