core/stanza_router.lua

changeset 372
e7c1e30d06d5
parent 360
e918c979ad1a
child 438
193f9dd64f17
--- 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]

mercurial