aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/stanza_router.lua7
-rw-r--r--net/connlisteners.lua16
-rw-r--r--net/server.lua2
3 files changed, 14 insertions, 11 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 2203f351..3814ffdf 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -93,6 +93,7 @@ function core_handle_stanza(origin, stanza)
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 @@ function core_route_stanza(origin, stanza)
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 --git a/net/connlisteners.lua b/net/connlisteners.lua
index a5c8755f..f7321cdc 100644
--- a/net/connlisteners.lua
+++ b/net/connlisteners.lua
@@ -23,14 +23,20 @@ function deregister(name)
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 --git a/net/server.lua b/net/server.lua
index 1661ba00..40cc6dc8 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -827,5 +827,5 @@ return {
stats = stats,
closeall = closeall,
addtimer = addtimer,
-
+ wraptlsclient = wraptlsclient,
}