projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util.dataforms: Fix form verification
[prosody.git]
/
util
/
stanza.lua
diff --git
a/util/stanza.lua
b/util/stanza.lua
index bf94411556b158c4eab8597cfaaf33d1350cee9b..600212a4d252470ee5dde1e6488ad8c0992da496 100644
(file)
--- a/
util/stanza.lua
+++ b/
util/stanza.lua
@@
-138,29
+138,20
@@
function stanza_mt:children()
end, self, i;
end
end, self, i;
end
-function stanza_mt:
matching_
tags(name, xmlns)
+function stanza_mt:
child
tags(name, xmlns)
xmlns = xmlns or self.attr.xmlns;
local tags = self.tags;
local start_i, max_i = 1, #tags;
return function ()
xmlns = xmlns or self.attr.xmlns;
local tags = self.tags;
local start_i, max_i = 1, #tags;
return function ()
- for i=start_i,max_i do
- v = tags[i];
- if (not name or v.name == name)
- and (not xmlns or xmlns == v.attr.xmlns) then
- start_i = i+1;
- return v;
- end
+ for i = start_i, max_i do
+ local v = tags[i];
+ if (not name or v.name == name)
+ and (not xmlns or xmlns == v.attr.xmlns) then
+ start_i = i+1;
+ return v;
end
end
- end, tags, i;
-end
-
-function stanza_mt:childtags()
- local i = 0;
- return function (a)
- i = i + 1
- local v = self.tags[i]
- if v then return v; end
- end, self.tags[1], i;
+ end
+ end;
end
function stanza_mt:maptags(callback)
end
function stanza_mt:maptags(callback)
@@
-267,11
+258,6
@@
function stanza_mt.get_error(stanza)
return type, condition or "undefined-condition", text;
end
return type, condition or "undefined-condition", text;
end
-function stanza_mt.__add(s1, s2)
- return s1:add_direct_child(s2);
-end
-
-
do
local id = 0;
function new_id()
do
local id = 0;
function new_id()