diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/xmppserver_listener.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua index 92b3b716..c7ff8379 100644 --- a/net/xmppserver_listener.lua +++ b/net/xmppserver_listener.lua @@ -134,6 +134,17 @@ function xmppserver.listener(conn, data) end end +function xmppserver.status(conn, status) + if status == "ssl-handshake-complete" then + local session = sessions[conn]; + if session and session.direction == "outgoing" then + local format, to_host, from_host = string.format, session.to_host, session.from_host; + session.log("warn", "Sending stream header..."); + session.sends2s(format([[<stream:stream xmlns='jabber:server' xmlns:db='jabber:server:dialback' xmlns:stream='http://etherx.jabber.org/streams' from='%s' to='%s' version='1.0'>]], from_host, to_host)); + end + end +end + function xmppserver.disconnect(conn, err) local session = sessions[conn]; if session then |