Software /
code /
prosody
Diff
util/dataforms.lua @ 6148:7dcd6f124c93
util.dataforms: Add support for XEP-0221: Data Forms Media Element
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 22 Apr 2014 23:36:26 +0200 |
parent | 5693:ef490e9276df |
child | 6149:2ae6e9063e88 |
child | 6467:77d00a895bbd |
line wrap: on
line diff
--- a/util/dataforms.lua Tue Apr 22 23:14:53 2014 +0200 +++ b/util/dataforms.lua Tue Apr 22 23:36:26 2014 +0200 @@ -93,6 +93,15 @@ end end end + + local media = field.media; + if media then + form:tag("media", { xmlns = "urn:xmpp:media-element", height = media.height, width = media.width }); + for _, val in ipairs(media) do + form:tag("uri", { type = val.type }):text(val.uri):up() + end + form:up(); + end if field.required then form:tag("required"):up();