aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-09-15 11:11:52 +0200
committerKim Alvefur <zash@zash.se>2022-09-15 11:11:52 +0200
commit473c68770eea1e3c96736b82f10eda5badcd63d9 (patch)
tree32a6a5a1f86a68cfc872a2627e855ffa3c80f57c /util/stanza.lua
parent1dd9e547ced3f6ce998b0e722dd4e4f9e69d5b07 (diff)
parentf6727510da6c46942aab44bbb0ce692bebd566e9 (diff)
downloadprosody-473c68770eea1e3c96736b82f10eda5badcd63d9.tar.gz
prosody-473c68770eea1e3c96736b82f10eda5badcd63d9.zip
Merge 0.12->trunk
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 24f3cb33..c6e7aa6d 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -167,6 +167,7 @@ function stanza_mt:get_child(name, xmlns)
return child;
end
end
+ return nil;
end
function stanza_mt:get_child_text(name, xmlns)
@@ -189,12 +190,14 @@ function stanza_mt:child_with_name(name)
for _, child in ipairs(self.tags) do
if child.name == name then return child; end
end
+ return nil;
end
function stanza_mt:child_with_ns(ns)
for _, child in ipairs(self.tags) do
if child.attr.xmlns == ns then return child; end
end
+ return nil;
end
function stanza_mt:get_child_with_attr(name, xmlns, attr_name, attr_value, normalize)
@@ -203,6 +206,7 @@ function stanza_mt:get_child_with_attr(name, xmlns, attr_name, attr_value, norma
return tag;
end
end
+ return nil;
end
function stanza_mt:children()
@@ -369,6 +373,7 @@ function stanza_mt.get_text(t)
if #t.tags == 0 then
return t_concat(t);
end
+ return nil;
end
function stanza_mt.get_error(stanza)