Software /
code /
prosody
Diff
core/stanza_router.lua @ 372:e7c1e30d06d5
Now possible to specify nil origin to core_route_stanza. Origin will be chosen as the host of the 'from' attribute on the stanza. Returns false on no such host.
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 21 Nov 2008 05:59:03 +0000 |
parent | 360:e918c979ad1a |
child | 438:193f9dd64f17 |
line wrap: on
line diff
--- a/core/stanza_router.lua Fri Nov 21 05:47:27 2008 +0000 +++ b/core/stanza_router.lua Fri Nov 21 05:59:03 2008 +0000 @@ -208,6 +208,10 @@ local from_node, from_host, from_resource = jid_split(from); local from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID + -- Auto-detect origin if not specified + origin = origin or hosts[from_host]; + if not origin then return false; end + if stanza.name == "presence" and (stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable") then resource = nil; end local host_session = hosts[host]