# HG changeset patch # User Matthew Wild # Date 1296515831 0 # Node ID 71b38dca22c3fc3e9756facd44d6a88ae193c2f6 # Parent 81636fa77cabd8c81017cc19ad4b4a70c2a472aa# Parent ccc16434dbe261c6fe9f393342afa5e1120f2d3f Merge 0.8->trunk diff -r 81636fa77cab -r 71b38dca22c3 util/stanza.lua --- a/util/stanza.lua Sat Jan 29 04:54:08 2011 +0500 +++ b/util/stanza.lua Mon Jan 31 23:17:11 2011 +0000 @@ -108,6 +108,14 @@ 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