From ad2660e96e9f4d839c385583e548eb5edd14767c Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 19 May 2009 01:07:03 +0500 Subject: stanza_router: Handle outbound presence if inbound handlers don't catch it --- core/stanza_router.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 1a9fb26c..6fa41232 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -123,7 +123,9 @@ function core_post_stanza(origin, stanza) 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); -- cgit v1.2.3