aboutsummaryrefslogtreecommitdiffstats
path: root/util/stanza.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-22 19:07:41 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-22 19:07:41 +0000
commit208dde8105928404941a6341ff7cdbedff6adb7c (patch)
tree1cd0936697d918db8eca9f897e7cab4838031453 /util/stanza.lua
parent3b1d2b2963e15660f198804f2f19d10ba0380af2 (diff)
downloadprosody-208dde8105928404941a6341ff7cdbedff6adb7c.tar.gz
prosody-208dde8105928404941a6341ff7cdbedff6adb7c.zip
Add helper function for adding message bodies to stanzas
Diffstat (limited to 'util/stanza.lua')
-rw-r--r--util/stanza.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 36e07317..df0d43ff 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -30,6 +30,11 @@ end
function stanza_mt:query(xmlns)
return self:tag("query", { xmlns = xmlns });
end
+
+function stanza_mt:body(text, attr)
+ return self:tag("body", attr):text(text);
+end
+
function stanza_mt:tag(name, attrs)
local s = stanza(name, attrs);
(self.last_add[#self.last_add] or self):add_direct_child(s);