Changeset

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 11880:d30c81b875f2
children 11882:c3bd71227e17
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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