# HG changeset patch # User Kim Alvefur # Date 1396561220 -7200 # Node ID a3d7b8f4d9c76693441efade8af7d78f11488d1d # Parent 29cbbe882441c992604d18979b4aa4548b10bd7a mod_compression: Use get_child() and get_child_text() diff -r 29cbbe882441 -r a3d7b8f4d9c7 plugins/mod_compression.lua --- a/plugins/mod_compression.lua Thu Apr 03 23:33:38 2014 +0200 +++ b/plugins/mod_compression.lua Thu Apr 03 23:40:20 2014 +0200 @@ -45,7 +45,7 @@ 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 @@ 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.");