Change sending reply stream header to use top_tag()
authorMatthew Wild <mwild1@gmail.com>
Thu, 13 Nov 2008 03:48:20 +0000 (03:48 +0000)
committerMatthew Wild <mwild1@gmail.com>
Thu, 13 Nov 2008 03:48:20 +0000 (03:48 +0000)
core/s2smanager.lua

index 1cfba5927b895d421e46fcaa4e2d8ff236109ef2..8a6d5b45a567dbfd0953ebd2d8425b6a0a2d7106 100644 (file)
@@ -133,7 +133,7 @@ function streamopened(session, attr)
                session.streamid = uuid_gen();
                print(session, session.from_host, "incoming s2s stream opened");
                send("<?xml version='1.0'?>");
-               send(format("<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' id='%s' from='%s'>", session.streamid, session.to_host));
+               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 }));
        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