stanza_router: Handle outbound presence if inbound handlers don't catch it

Tue, 19 May 2009 01:07:03 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Tue, 19 May 2009 01:07:03 +0500
changeset 1182
89e9f0d555a2
parent 1181
dffbb7d1da4b
child 1183
565e16ee0c74

stanza_router: Handle outbound presence if inbound handlers don't catch it

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Sun May 17 04:50:32 2009 +0500
+++ b/core/stanza_router.lua	Tue May 19 01:07:03 2009 +0500
@@ -123,7 +123,9 @@
 	local to_bare = node and (node.."@"..host) or host; -- bare JID
 
 	local event_data = {origin=origin, stanza=stanza};
-	if fire_event(tostring(host or origin.host).."/"..stanza.name, event_data) then
+	if host and fire_event(host.."/"..stanza.name, event_data) then
+		-- event handled
+	elseif stanza.name == "presence" and origin.host and fire_event(origin.host.."/"..stanza.name, event_data) then
 		-- event handled
 	elseif not to then
 		modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);

mercurial