diff util/dataforms.lua @ 11881:2138fc13d53a

util.dataforms: Encode size attributes as integers in XEP-0221 media element Otherwise very large fields would be serialized in e notation
author Kim Alvefur <zash@zash.se>
date Thu, 28 Oct 2021 13:02:59 +0200
parents d30c81b875f2
children d10957394a3c
line wrap: on
line diff
--- a/util/dataforms.lua	Thu Oct 28 13:00:24 2021 +0200
+++ b/util/dataforms.lua	Thu Oct 28 13:02:59 2021 +0200
@@ -151,7 +151,7 @@
 
 		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