aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-02 19:49:15 +0200
committerKim Alvefur <zash@zash.se>2018-06-02 19:49:15 +0200
commit5b1a2360296bfec2e8ff7242a6c12cda54521f6a (patch)
tree7eec98774d78a9a7fee9929354c36e83ede3a8d9 /util/dataforms.lua
parent2a7da895670617e0de10de8e58d903e04498a83c (diff)
downloadprosody-5b1a2360296bfec2e8ff7242a6c12cda54521f6a.tar.gz
prosody-5b1a2360296bfec2e8ff7242a6c12cda54521f6a.zip
util.dataforms: Remove string conversion to let util.stanza validate types
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r--util/dataforms.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 9f11bed2..8c5b8ee2 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -8,7 +8,7 @@
local setmetatable = setmetatable;
local ipairs = ipairs;
-local tostring, type, next = tostring, type, next;
+local type, next = type, next;
local t_concat = table.concat;
local st = require "util.stanza";
local jid_prep = require "util.jid".prep;
@@ -49,7 +49,7 @@ function form_t.form(layout, data, formtype)
:add_child(value)
:up();
else
- form:tag("value"):text(tostring(value)):up();
+ form:tag("value"):text(value):up();
end
elseif field_type == "boolean" then
form:tag("value"):text((value and "1") or "0"):up();
@@ -79,7 +79,7 @@ function form_t.form(layout, data, formtype)
has_default = true;
end
else
- form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up();
+ form:tag("option", { label= val }):tag("value"):text(val):up():up();
end
end
end
@@ -95,7 +95,7 @@ function form_t.form(layout, data, formtype)
form:tag("value"):text(val.value):up();
end
else
- form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up();
+ form:tag("option", { label= val }):tag("value"):text(val):up():up();
end
end
end