aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-14 02:47:40 +0200
committerKim Alvefur <zash@zash.se>2017-09-14 02:47:40 +0200
commit989c0783cb8fd86874f5f0bdcbdba30522e5fcb3 (patch)
treeea4eaaedde84528b2ec13e31812a2ce4e5c30610 /plugins/mod_s2s/mod_s2s.lua
parent015bc6ad59c4fec1c353d9af6b4e111a287c2148 (diff)
parent5dee36d8385e36c4d72a97a33cf3c934af3d6633 (diff)
downloadprosody-989c0783cb8fd86874f5f0bdcbdba30522e5fcb3.tar.gz
prosody-989c0783cb8fd86874f5f0bdcbdba30522e5fcb3.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins/mod_s2s/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua18
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 4b3996bb..c060b974 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -422,16 +422,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 "");