diff options
author | Kim Alvefur <zash@zash.se> | 2017-09-14 01:27:36 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-09-14 01:27:36 +0200 |
commit | 18284b53e5c420330a3ba127b65d2c07ead0ff22 (patch) | |
tree | a9b92a43a132af45694c9650f643c0b0ef2ae332 /plugins/mod_s2s/mod_s2s.lua | |
parent | 64ce7c413a4870c7fd8ceca5b537699df9063dca (diff) | |
download | prosody-18284b53e5c420330a3ba127b65d2c07ead0ff22.tar.gz prosody-18284b53e5c420330a3ba127b65d2c07ead0ff22.zip |
mod_component, mod_s2s: Iterate over child tags instead of child nodes (can include text) in stream error (same as 176b7f4e4ac9)
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua index e038e5b4..10b81a17 100644 --- a/plugins/mod_s2s/mod_s2s.lua +++ b/plugins/mod_s2s/mod_s2s.lua @@ -416,16 +416,14 @@ function stream_callbacks.error(session, error, data) session:close("not-well-formed"); elseif error == "stream-error" then local condition, text = "undefined-condition"; - for child in data:children() do - if child.attr.xmlns == xmlns_xmpp_streams then - if child.name ~= "text" then - condition = child.name; - else - text = child:get_text(); - end - if condition ~= "undefined-condition" and text then - break; - end + for child in data:childtags(nil, xmlns_xmpp_streams) do + if child.name ~= "text" then + condition = child.name; + else + text = child:get_text(); + end + if condition ~= "undefined-condition" and text then + break; end end text = condition .. (text and (" ("..text..")") or ""); |