stanza_router: Prevent further processing of a handled stanza

Fri, 15 May 2009 06:31:32 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 15 May 2009 06:31:32 +0500
changeset 1148
5dafbc0ded34
parent 1147
513c1d071045
child 1149
72fc323050c1

stanza_router: Prevent further processing of a handled stanza

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Fri May 15 06:28:02 2009 +0500
+++ b/core/stanza_router.lua	Fri May 15 06:31:32 2009 +0500
@@ -109,7 +109,7 @@
 	-- FIXME do stanzas not of jabber:client get handled by components?
 	if (origin.type == "s2sin" or origin.type == "c2s" or origin.type == "component") and (not xmlns or xmlns == "jabber:server" or xmlns == "jabber:client") then			
 		local event_data = {origin=origin, stanza=stanza};
-		fire_event(tostring(host or origin.host).."/"..stanza.name, event_data);
+		if fire_event(tostring(host or origin.host).."/"..stanza.name, event_data) then return; end
 		if origin.type == "s2sin" and not origin.dummy then
 			local host_status = origin.hosts[from_host];
 			if not host_status or not host_status.authed then -- remote server trying to impersonate some other server?

mercurial