diff -r f928cb5c5d04 -r e8934ce6ea0f util/stanza.lua --- a/util/stanza.lua Mon Aug 15 16:35:14 2022 +0200 +++ b/util/stanza.lua Wed Aug 17 19:04:30 2022 +0200 @@ -176,6 +176,14 @@ return nil; end +function stanza_mt:get_child_attr(name, xmlns, attr) + local tag = self:get_child(name, xmlns); + if tag then + return tag.attr[attr]; + 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