# HG changeset patch # User Matthew Wild # Date 1227071587 0 # Node ID 6a7acfc1c93374a188e59763a2c73b4e8f89dd87 # Parent ed5824e9dd94206705146713f9946396dde83689 Send version=1.0 in s2s stream header. Send s2s stream:features when in 1.0 mode. diff -r ed5824e9dd94 -r 6a7acfc1c933 core/s2smanager.lua --- a/core/s2smanager.lua Wed Nov 19 05:12:21 2008 +0000 +++ b/core/s2smanager.lua Wed Nov 19 05:13:07 2008 +0000 @@ -160,12 +160,28 @@ session.streamid = uuid_gen(); print(session, session.from_host, "incoming s2s stream opened"); send(""); - send(stanza("stream:stream", { xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host }):top_tag()); + send(stanza("stream:stream", { version = '1.0', xmlns='jabber:server', ["xmlns:db"]='jabber:server:dialback', ["xmlns:stream"]='http://etherx.jabber.org/streams', id=session.streamid, from=session.to_host }):top_tag()); if session.to_host and not hosts[session.to_host] then -- Attempting to connect to a host we don't serve session:close("host-unknown"); return; end + if session.version >= 1.0 then + send(st.stanza("stream:features") + :tag("dialback", { xmlns='urn:xmpp:features:dialback' }):tag("optional"):up():up()); + end + --[[ + local features = {}; + modulemanager.fire_event("stream-features-s2s", session, features); + + send(""); + + for _, feature in ipairs(features) do + send(tostring(feature)); + end + + send(""); + ]] elseif session.direction == "outgoing" then -- If we are just using the connection for verifying dialback keys, we won't try and auth it if not attr.id then error("stream response did not give us a streamid!!!"); end @@ -177,17 +193,6 @@ mark_connected(session); end end - --[[ - local features = {}; - modulemanager.fire_event("stream-features-s2s", session, features); - - send(""); - - for _, feature in ipairs(features) do - send(tostring(feature)); - end - - send("");]] session.notopen = nil; end