Software /
code /
prosody
Comparison
util/dataforms.lua @ 5551:e1e06f1465be
util.dataforms: Add support for generating type='fixed' fields
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Mon, 11 Feb 2013 23:46:45 +0100 |
parent | 4928:5211c11dd865 |
child | 5693:ef490e9276df |
comparison
equal
deleted
inserted
replaced
5329:9fffd5fad4b3 | 5551:e1e06f1465be |
---|---|
51 form:tag("value"):text(tostring(value)):up(); | 51 form:tag("value"):text(tostring(value)):up(); |
52 end | 52 end |
53 elseif field_type == "boolean" then | 53 elseif field_type == "boolean" then |
54 form:tag("value"):text((value and "1") or "0"):up(); | 54 form:tag("value"):text((value and "1") or "0"):up(); |
55 elseif field_type == "fixed" then | 55 elseif field_type == "fixed" then |
56 | 56 form:tag("value"):text(value):up(); |
57 elseif field_type == "jid-multi" then | 57 elseif field_type == "jid-multi" then |
58 for _, jid in ipairs(value) do | 58 for _, jid in ipairs(value) do |
59 form:tag("value"):text(jid):up(); | 59 form:tag("value"):text(jid):up(); |
60 end | 60 end |
61 elseif field_type == "jid-single" then | 61 elseif field_type == "jid-single" then |