diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-22 19:07:41 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-22 19:07:41 +0000 |
commit | 208dde8105928404941a6341ff7cdbedff6adb7c (patch) | |
tree | 1cd0936697d918db8eca9f897e7cab4838031453 /util/stanza.lua | |
parent | 3b1d2b2963e15660f198804f2f19d10ba0380af2 (diff) | |
download | prosody-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.lua | 5 |
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); |