Diff

plugins/mod_compression.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 4898:010c01841ed0
child 5535:0df0afc041d7
line wrap: on
line diff
--- a/plugins/mod_compression.lua	Fri Mar 15 09:51:43 2013 +0100
+++ b/plugins/mod_compression.lua	Sat Mar 16 17:46:43 2013 +0100
@@ -141,10 +141,7 @@
 		-- setup decompression for session.data
 		setup_decompression(session, inflate_stream);
 		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();
 		session.compressed = true;
 		return true;
 	end