Software /
code /
prosody
Comparison
util/stanza.lua @ 2:9bb397205f26
Working presence!
author | matthew |
---|---|
date | Sun, 24 Aug 2008 04:34:01 +0000 |
parent | 1:b8787e859fd2 |
child | 4:09c3845ed442 |
comparison
equal
deleted
inserted
replaced
1:b8787e859fd2 | 2:9bb397205f26 |
---|---|
66 local v = a[i] | 66 local v = a[i] |
67 if v then return v; end | 67 if v then return v; end |
68 end, self, i; | 68 end, self, i; |
69 | 69 |
70 end | 70 end |
71 function stanza_mt:childtags() | |
72 local i = 0; | |
73 return function (a) | |
74 i = i + 1 | |
75 local v = self.tags[i] | |
76 if v then return v; end | |
77 end, self.tags[1], i; | |
78 | |
79 end | |
71 | 80 |
72 function stanza_mt.__tostring(t) | 81 function stanza_mt.__tostring(t) |
73 local children_text = ""; | 82 local children_text = ""; |
74 for n, child in ipairs(t) do | 83 for n, child in ipairs(t) do |
75 children_text = children_text .. tostring(child); | 84 children_text = children_text .. tostring(child); |