Diff

plugins/mod_saslauth.lua @ 5351:901ed253bbf7

mod_s2s, mod_saslauth, mod_compression: Refactor to have common code for opening streams
author Kim Alvefur <zash@zash.se>
date Sat, 16 Mar 2013 17:46:43 +0100
parent 4939:0545a574667b
child 5362:612467e263af
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Fri Mar 15 09:51:43 2013 +0100
+++ b/plugins/mod_saslauth.lua	Sat Mar 16 17:46:43 2013 +0100
@@ -88,11 +88,7 @@
 	module:log("debug", "SASL EXTERNAL with %s succeeded", session.to_host);
 	session.external_auth = "succeeded"
 	session:reset_stream();
-
-	local default_stream_attr = {xmlns = "jabber:server", ["xmlns:stream"] = "http://etherx.jabber.org/streams",
-	                            ["xmlns:db"] = 'jabber:server:dialback', version = "1.0", to = session.to_host, from = session.from_host};
-	session.sends2s("<?xml version='1.0'?>");
-	session.sends2s(st.stanza("stream:stream", default_stream_attr):top_tag());
+	session:open_stream();
 
 	s2s_make_authenticated(session, session.to_host);
 	return true;