aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commit3937703c4d9a2ea3200d93d7e3a1eecea3f1e1cb (patch)
treeea4eaaedde84528b2ec13e31812a2ce4e5c30610 /plugins
parent7a8be313e8ea82fa310e9467a3086c2dac2010b7 (diff)
parentf36218aed8ff4ee2694f5b9dc3c0a4943d9ca006 (diff)
downloadprosody-3937703c4d9a2ea3200d93d7e3a1eecea3f1e1cb.tar.gz
prosody-3937703c4d9a2ea3200d93d7e3a1eecea3f1e1cb.zip
Merge 0.9->0.10
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua18
-rw-r--r--plugins/mod_component.lua18
-rw-r--r--plugins/mod_s2s/mod_s2s.lua18
3 files changed, 24 insertions, 30 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index fbc22be6..f77c3741 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -111,16 +111,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 "");
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 573b2c8e..476dff8a 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -170,16 +170,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 "");
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 "");