projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab46b5b
)
Add helper function for adding message bodies to stanzas
author
Matthew Wild
<mwild1@gmail.com>
Sat, 22 Nov 2008 19:07:41 +0000
(19:07 +0000)
committer
Matthew Wild
<mwild1@gmail.com>
Sat, 22 Nov 2008 19:07:41 +0000
(19:07 +0000)
util/stanza.lua
patch
|
blob
|
history
diff --git
a/util/stanza.lua
b/util/stanza.lua
index 36e07317e866d7ba55c967765adc1dbb33a262c6..df0d43ff7f3ac163bf4a3f5f9b99a7ae0965a381 100644
(file)
--- 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);