aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-08-16 12:55:55 +0200
committerKim Alvefur <zash@zash.se>2020-08-16 12:55:55 +0200
commit1c0e4300ab36e37cb2ba83e5dca9f9247785bed6 (patch)
tree7bef008214ad5430778375bab6e6b3b3095b6d5b /util
parent9287d929c220bd88fff5458f143f24512800a63e (diff)
downloadprosody-1c0e4300ab36e37cb2ba83e5dca9f9247785bed6.tar.gz
prosody-1c0e4300ab36e37cb2ba83e5dca9f9247785bed6.zip
util.dataforms: Convert media element sizes to avoid error on Lua 5.3
The stanza API does not accept number values and threw an error due to the height and width attributes of the media element (XEP-0221). This part had no test coverage previously, explaining why it was not discovered until now.
Diffstat (limited to 'util')
-rw-r--r--util/dataforms.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 052d6a55..449c1a58 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -136,7 +136,7 @@ function form_t.form(layout, data, formtype)
local media = field.media;
if media then
- form:tag("media", { xmlns = "urn:xmpp:media-element", height = media.height, width = media.width });
+ form:tag("media", { xmlns = "urn:xmpp:media-element", height = ("%g"):format(media.height), width = ("%g"):format(media.width) });
for _, val in ipairs(media) do
form:tag("uri", { type = val.type }):text(val.uri):up()
end