diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-21 05:59:03 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-21 05:59:03 +0000 |
commit | 3b1d2b2963e15660f198804f2f19d10ba0380af2 (patch) | |
tree | 6771ed19cf395f6de89c1caa148a5f3809e71874 /core/stanza_router.lua | |
parent | ede1bd83a82243ffd64b44bd4fda445f8eb97a2c (diff) | |
download | prosody-3b1d2b2963e15660f198804f2f19d10ba0380af2.tar.gz prosody-3b1d2b2963e15660f198804f2f19d10ba0380af2.zip |
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.
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r-- | core/stanza_router.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index a3837ddd..2505fca3 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -208,6 +208,10 @@ function core_route_stanza(origin, stanza) 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] |