aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-01-31 23:17:11 +0000
committerMatthew Wild <mwild1@gmail.com>2011-01-31 23:17:11 +0000
commit373838b53ab87ac57830e2e833ddf78671101f72 (patch)
tree8d29f8c218d9a0115a2140287398ab4b31fcf576 /util
parentd76f04e84ecd78b6b9b0e2e354d51a847491fea4 (diff)
parent22bd191f8634a478a7b2ca1a020270471bcd08c6 (diff)
downloadprosody-373838b53ab87ac57830e2e833ddf78671101f72.tar.gz
prosody-373838b53ab87ac57830e2e833ddf78671101f72.zip
Merge 0.8->trunk
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua8
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