aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-24 03:42:26 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-24 03:42:26 +0100
commit8fa7f063020263100d17978e2c97f9441d9db337 (patch)
treef65bff5e9096c367b1814320639b144230d326e9 /core
parenteb8e9997e03f6b0c399af0a6f88ee85684c74d06 (diff)
downloadprosody-8fa7f063020263100d17978e2c97f9441d9db337.tar.gz
prosody-8fa7f063020263100d17978e2c97f9441d9db337.zip
working outgoing s2s \o/
Diffstat (limited to 'core')
-rw-r--r--core/stanza_router.lua12
-rw-r--r--core/xmlhandlers.lua1
2 files changed, 12 insertions, 1 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index fd62a18e..215b01a0 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -13,6 +13,7 @@ local send_s2s = require "core.s2smanager".send_to_host;
local user_exists = require "core.usermanager".user_exists;
local s2s_verify_dialback = require "core.s2smanager".verify_dialback;
+local s2s_make_authenticated = require "core.s2smanager".make_authenticated;
local format = string.format;
local tostring = tostring;
@@ -109,6 +110,15 @@ function core_handle_stanza(origin, stanza)
end
origin.send(format("<db:verify from='%s' to='%s' id='%s' type='%s'>%s</db:verify>", attr.to, attr.from, attr.id, type, stanza[1]));
end
+ elseif origin.type == "s2sout_unauthed" then
+ if stanza.name == "result" and stanza.attr.xmlns == "jabber:server:dialback" then
+ if stanza.attr.type == "valid" then
+ s2s_make_authenticated(origin);
+ else
+ -- FIXME
+ error("dialback failed!");
+ end
+ end
else
log("warn", "Unhandled origin: %s", origin.type);
end
@@ -208,6 +218,8 @@ function core_route_stanza(origin, stanza)
end
else
-- Remote host
+ log("debug", "sending s2s stanza: %s", tostring(stanza));
+ stanza.attr.xmlns = "jabber:server";
send_s2s(origin.host, host, stanza);
end
stanza.attr.to = to; -- reset
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index 4187819c..9b76731a 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -35,7 +35,6 @@ function init_xmlhandlers(session, streamopened)
stanza:text(t_concat(chardata));
chardata = {};
end
- log("debug", "Start element: %s", tostring(name));
curr_ns,name = name:match("^(.+):([%w%-]+)$");
attr.xmlns = curr_ns;