Software /
code /
prosody
Diff
core/stanza_router.lua @ 1182:89e9f0d555a2
stanza_router: Handle outbound presence if inbound handlers don't catch it
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Tue, 19 May 2009 01:07:03 +0500 |
parent | 1179:503d68e7e18a |
child | 1191:7f965bd37d65 |
line wrap: on
line diff
--- 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);