function(session ,stanza)
session.log("debug", "Activating compression...")
-- create deflate and inflate streams
function(session ,stanza)
session.log("debug", "Activating compression...")
-- create deflate and inflate streams
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'?>");
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'?>");
-- checking if the compression method is supported
local method = stanza:child_with_name("method")[1];
if method == "zlib" then
-- checking if the compression method is supported
local method = stanza:child_with_name("method")[1];
if method == "zlib" then
if not inflate_stream then return end
(session.sends2s or session.send)(st.stanza("compressed", {xmlns=xmlns_compression_protocol}));
if not inflate_stream then return end
(session.sends2s or session.send)(st.stanza("compressed", {xmlns=xmlns_compression_protocol}));
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method");
(session.sends2s or session.send)(error_st);
end
local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method");
(session.sends2s or session.send)(error_st);
end