aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-10-28 13:02:59 +0200
committerKim Alvefur <zash@zash.se>2021-10-28 13:02:59 +0200
commitff2e0641b9e2f0d251c59ca9f80d72f07f4dc7ec (patch)
tree5f488281651c3ef59d47d2f7d1402af5ae994fbe
parent1a0be02fe85a105c48b82aac82c6d082a08f25b0 (diff)
downloadprosody-ff2e0641b9e2f0d251c59ca9f80d72f07f4dc7ec.tar.gz
prosody-ff2e0641b9e2f0d251c59ca9f80d72f07f4dc7ec.zip
util.dataforms: Encode size attributes as integers in XEP-0221 media element
Otherwise very large fields would be serialized in e notation
-rw-r--r--util/dataforms.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 4daebbcb..66733895 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -151,7 +151,7 @@ function form_t.form(layout, data, formtype)
local media = field.media;
if media then
- form:tag("media", { xmlns = "urn:xmpp:media-element", height = ("%g"):format(media.height), width = ("%g"):format(media.width) });
+ form:tag("media", { xmlns = "urn:xmpp:media-element", height = ("%d"):format(media.height), width = ("%d"):format(media.width) });
for _, val in ipairs(media) do
form:tag("uri", { type = val.type }):text(val.uri):up()
end