Changeset

68:ceb7a55676a4

Beginnings of real stanza routing
author Matthew Wild <mwild1@gmail.com>
date Sun, 05 Oct 2008 19:48:25 +0100
parents 67:563360207292
children 69:5b664c8fef86
files core/stanza_router.lua
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/stanza_router.lua	Sun Oct 05 19:16:32 2008 +0100
+++ b/core/stanza_router.lua	Sun Oct 05 19:48:25 2008 +0100
@@ -41,7 +41,21 @@
 
 function core_route_stanza(origin, stanza)
 	-- Hooks
+	--- ...later
+	
 	-- Deliver
+	local node, host, resource = jid_split(stanza.attr.to);
+	local host_session = hosts[host]
+	if host_session and host_session.type == "local" then
+		-- Local host
+	else
+		-- Remote host
+		if host_session then
+			-- Send to session
+		else
+			-- Need to establish the connection
+		end
+	end
 end
 
 function handle_stanza_nodest(stanza)