projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
661beb6
)
util.stanza: Add stanza:get_text() to retrieve all child text nodes #api
author
Matthew Wild
<mwild1@gmail.com>
Fri, 26 Jun 2009 04:54:55 +0000
(
05:54
+0100)
committer
Matthew Wild
<mwild1@gmail.com>
Fri, 26 Jun 2009 04:54:55 +0000
(
05:54
+0100)
util/stanza.lua
patch
|
blob
|
history
diff --git
a/util/stanza.lua
b/util/stanza.lua
index aff0bfc7df7b989b6e1045cddb0f7ee675b03195..eb9f392209d78b6ea60c53f95def5026645bbbec 100644
(file)
--- a/
util/stanza.lua
+++ b/
util/stanza.lua
@@
-158,6
+158,12
@@
function stanza_mt.top_tag(t)
return s_format("<%s%s>", t.name, attr_string);
end
+function stanza_mt.get_text(t)
+ if #t.tags == 0 then
+ return t_concat(t);
+ end
+end
+
function stanza_mt.__add(s1, s2)
return s1:add_direct_child(s2);
end