Changeset

157:f4e9b6ec34b0

Hack until we get SRV resolving
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Oct 2008 14:59:04 +0100
parents 156:884c43c7028a
children 158:7ea96f944681
files core/s2smanager.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Fri Oct 24 14:47:23 2008 +0100
+++ b/core/s2smanager.lua	Fri Oct 24 14:59:04 2008 +0100
@@ -20,6 +20,8 @@
 
 local dialback_secret = "This is very secret!!! Ha!";
 
+local srvmap = { ["gmail.com"] = "talk.google.com", ["identi.ca"] = "longlance.controlezvous.ca" };
+
 module "s2smanager"
 
 function connect_host(from_host, to_host)
@@ -64,6 +66,7 @@
 		
 		local conn, handler = socket.tcp()
 		--FIXME: Below parameters (ports/ip) are incorrect (use SRV)
+		to_host = srvmap[to_host] or to_host;
 		conn:connect(to_host, 5269);
 		conn = wraptlsclient(cl, conn, to_host, 5269, 0, 1, hosts[from_host].ssl_ctx );
 		host_session.conn = conn;