projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
832e94d
)
util.stanza: stanza:reset() method to reset building state
author
Matthew Wild
<mwild1@gmail.com>
Wed, 8 Apr 2009 19:12:40 +0000
(20:12 +0100)
committer
Matthew Wild
<mwild1@gmail.com>
Wed, 8 Apr 2009 19:12:40 +0000
(20:12 +0100)
util/stanza.lua
patch
|
blob
|
history
diff --git
a/util/stanza.lua
b/util/stanza.lua
index 1ad3679ba84579bc92122d18146272bdc9730ad7..7e40dfa43d1dadb14e4fa0e24ab88dd12d805f75 100644
(file)
--- a/
util/stanza.lua
+++ b/
util/stanza.lua
@@
-65,6
+65,14
@@
function stanza_mt:up()
return self;
end
+function stanza_mt:reset()
+ local last_add = self.last_add;
+ for i = 1,#last_add do
+ last_add[i] = nil;
+ end
+ return self;
+end
+
function stanza_mt:add_direct_child(child)
if type(child) == "table" then
t_insert(self.tags, child);