diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/stanza.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua index afaf9ce9..79c1a71e 100644 --- a/util/stanza.lua +++ b/util/stanza.lua @@ -108,6 +108,14 @@ function stanza_mt:get_child(name, xmlns) end end +function stanza_mt:get_child_text(name, xmlns) + local tag = self:get_child(name, xmlns); + if tag then + return tag:get_text(); + end + return nil; +end + function stanza_mt:child_with_name(name) for _, child in ipairs(self.tags) do if child.name == name then return child; end |