# HG changeset patch # User Matthew Wild # Date 1224816146 -3600 # Node ID 3826ca244eb6a83d36353af1a4f330fabc20c83d # Parent fbb3a4ff9cf1c262063ab47a3cfb8709874b07e8 working outgoing s2s \o/ diff -r fbb3a4ff9cf1 -r 3826ca244eb6 core/stanza_router.lua --- a/core/stanza_router.lua Fri Oct 24 03:06:55 2008 +0100 +++ b/core/stanza_router.lua Fri Oct 24 03:42:26 2008 +0100 @@ -13,6 +13,7 @@ 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 @@ end origin.send(format("%s", 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 @@ 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 -r fbb3a4ff9cf1 -r 3826ca244eb6 core/xmlhandlers.lua --- a/core/xmlhandlers.lua Fri Oct 24 03:06:55 2008 +0100 +++ b/core/xmlhandlers.lua Fri Oct 24 03:42:26 2008 +0100 @@ -35,7 +35,6 @@ stanza:text(t_concat(chardata)); chardata = {}; end - log("debug", "Start element: %s", tostring(name)); curr_ns,name = name:match("^(.+):([%w%-]+)$"); attr.xmlns = curr_ns;