# HG changeset patch # User Matthew Wild # Date 1224781779 -3600 # Node ID 93f3c6b94c755d42c61e4a03f1fc5727a2ed79d6 # Parent 63863534b1f11a48ec1190bccee7993d79beeaab Initial s2s stuff diff -r 63863534b1f1 -r 93f3c6b94c75 core/stanza_router.lua --- a/core/stanza_router.lua Thu Oct 23 18:05:06 2008 +0100 +++ b/core/stanza_router.lua Thu Oct 23 18:09:39 2008 +0100 @@ -93,6 +93,7 @@ end end +-- TODO: Does this function belong here? function is_authorized_to_see_presence(origin, username, host) local roster = datamanager.load(username, host, "roster") or {}; local item = roster[origin.username.."@"..origin.host]; @@ -186,11 +187,7 @@ end else -- Remote host - if host_session then - -- Send to session - else - -- Need to establish the connection - end + send_s2s(origin.host, host, stanza); end stanza.attr.to = to; -- reset end diff -r 63863534b1f1 -r 93f3c6b94c75 net/connlisteners.lua --- a/net/connlisteners.lua Thu Oct 23 18:05:06 2008 +0100 +++ b/net/connlisteners.lua Thu Oct 23 18:09:39 2008 +0100 @@ -23,14 +23,20 @@ listeners[name] = nil; end -function start(name, udata) - local h = listeners[name] +function get(name) + local h = listeners[name]; if not h then pcall(dofile, "net/"..name:gsub("[^%w%-]", "_").."_listener.lua"); h = listeners[name]; - if not h then - error("No such connection module: "..name, 0); - end + + end + return h; +end + +function start(name, udata) + local h = get(name); + if not h then + error("No such connection module: "..name, 0); end return server_add(h, udata.port or h.default_port or error("Can't start listener "..name.." because no port was specified, and it has no default port", 0), diff -r 63863534b1f1 -r 93f3c6b94c75 net/server.lua --- a/net/server.lua Thu Oct 23 18:05:06 2008 +0100 +++ b/net/server.lua Thu Oct 23 18:09:39 2008 +0100 @@ -827,5 +827,5 @@ stats = stats, closeall = closeall, addtimer = addtimer, - + wraptlsclient = wraptlsclient, }