Beginnings of real stanza routing

Sun, 05 Oct 2008 19:48:25 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Sun, 05 Oct 2008 19:48:25 +0100
changeset 68
ceb7a55676a4
parent 67
563360207292
child 69
5b664c8fef86

Beginnings of real stanza routing

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- 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)

mercurial