# HG changeset patch # User Kim Alvefur # Date 1396561692 -7200 # Node ID 1607b03356ed8ecb4addc65ef392d841598823d6 # Parent a3d7b8f4d9c76693441efade8af7d78f11488d1d mod_compression: Only iterate over correctly named and namespaced child tags of compression feature diff -r a3d7b8f4d9c7 -r 1607b03356ed plugins/mod_compression.lua --- a/plugins/mod_compression.lua Thu Apr 03 23:40:20 2014 +0200 +++ b/plugins/mod_compression.lua Thu Apr 03 23:48:12 2014 +0200 @@ -48,8 +48,8 @@ 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 - local algorithm = a[1] + for a in comp_st:childtags("method") do + local algorithm = a:get_text(); if algorithm == "zlib" then session.sends2s(st.stanza("compress", {xmlns=xmlns_compression_protocol}):tag("method"):text("zlib")) session.log("debug", "Enabled compression using zlib.")