Software /
code /
prosody
Changeset
2070:25dc4b9d06b1
util.dataforms: Support for jid-multi field type
author | Florian Zeitz |
---|---|
date | Fri, 06 Nov 2009 23:51:14 +0000 |
parents | 2068:1e1ee53d7f6e |
children | 2071:d59537f54c24 |
files | util/dataforms.lua |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/dataforms.lua Mon Nov 02 00:52:35 2009 +0500 +++ b/util/dataforms.lua Fri Nov 06 23:51:14 2009 +0000 @@ -118,6 +118,17 @@ field_readers["jid-single"] = field_readers["text-single"]; +field_readers["jid-multi"] = + function (field_tag) + local result = {}; + for value_tag in field_tag:childtags() do + if value_tag.name == "value" then + result[#result+1] = value_tag[1]; + end + end + return result; + end + field_readers["text-multi"] = function (field_tag) local result = {};