aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-04-03 23:40:20 +0200
committerKim Alvefur <zash@zash.se>2014-04-03 23:40:20 +0200
commit104f09e13579a81ae40d60af1c398311a12a32ca (patch)
tree7fb026e37ba424d69da055cc91a5bc87c40c9cd3
parenta09b2b2420f08fa40ba6a0e4c62e401ab125f6d2 (diff)
downloadprosody-104f09e13579a81ae40d60af1c398311a12a32ca.tar.gz
prosody-104f09e13579a81ae40d60af1c398311a12a32ca.zip
mod_compression: Use get_child() and get_child_text()
-rw-r--r--plugins/mod_compression.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index 3b000303..e4e521b7 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -45,7 +45,7 @@ module:hook_stanza(xmlns_stream, "features",
function (session, stanza)
if not session.compressed and session.type == "s2sout" then
-- does remote server support compression?
- local comp_st = stanza:child_with_name("compression");
+ local comp_st = stanza:get_child("compression", xmlns_compression_feature);
if comp_st then
-- do we support the mechanism
for a in comp_st:children() do
@@ -160,8 +160,7 @@ module:hook("stanza/http://jabber.org/protocol/compress:compress", function(even
end
-- checking if the compression method is supported
- local method = stanza:child_with_name("method");
- method = method and (method[1] or "");
+ local method = stanza:get_child_text("method");
if method == "zlib" then
session.log("debug", "zlib compression enabled.");