# HG changeset patch # User Florian Zeitz # Date 1257551474 0 # Node ID 25dc4b9d06b148b0709942e058f3051430eef333 # Parent 1e1ee53d7f6eab0d70d4735a1184095700b797d1 util.dataforms: Support for jid-multi field type diff -r 1e1ee53d7f6e -r 25dc4b9d06b1 util/dataforms.lua --- 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 = {};