From b27c56326695c39a06d9d6fb1b8982c4f23b82f7 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 19 Nov 2008 05:13:07 +0000 Subject: Send version=1.0 in s2s stream header. Send s2s stream:features when in 1.0 mode. --- core/s2smanager.lua | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'core/s2smanager.lua') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 7d07ad7a..a61157c0 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -160,12 +160,28 @@ function streamopened(session, attr) 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 @@ function streamopened(session, attr) 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 -- cgit v1.2.3