Software /
code /
prosody
Comparison
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 |
parent | 11880:d30c81b875f2 |
child | 12975:d10957394a3c |
comparison
equal
deleted
inserted
replaced
11880:d30c81b875f2 | 11881:2138fc13d53a |
---|---|
149 end | 149 end |
150 end | 150 end |
151 | 151 |
152 local media = field.media; | 152 local media = field.media; |
153 if media then | 153 if media then |
154 form:tag("media", { xmlns = "urn:xmpp:media-element", height = ("%g"):format(media.height), width = ("%g"):format(media.width) }); | 154 form:tag("media", { xmlns = "urn:xmpp:media-element", height = ("%d"):format(media.height), width = ("%d"):format(media.width) }); |
155 for _, val in ipairs(media) do | 155 for _, val in ipairs(media) do |
156 form:tag("uri", { type = val.type }):text(val.uri):up() | 156 form:tag("uri", { type = val.type }):text(val.uri):up() |
157 end | 157 end |
158 form:up(); | 158 form:up(); |
159 end | 159 end |