Fri, 26 Jun 2009 05:54:55 +0100
util.stanza: Add stanza:get_text() to retrieve all child text nodes #api
util/stanza.lua | file | annotate | diff | comparison | revisions |
--- a/util/stanza.lua Fri Jun 26 05:54:03 2009 +0100 +++ b/util/stanza.lua Fri Jun 26 05:54:55 2009 +0100 @@ -158,6 +158,12 @@ return s_format("<%s%s>", t.name, attr_string); end +function stanza_mt.get_text(t) + if #t.tags == 0 then + return t_concat(t); + end +end + function stanza_mt.__add(s1, s2) return s1:add_direct_child(s2); end