From e02bb3f3073423bed59f322907d186d75372bc0d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 22 Apr 2014 23:36:26 +0200 Subject: util.dataforms: Add support for XEP-0221: Data Forms Media Element --- util/dataforms.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util/dataforms.lua') diff --git a/util/dataforms.lua b/util/dataforms.lua index 52924841..01a8eef3 100644 --- a/util/dataforms.lua +++ b/util/dataforms.lua @@ -93,6 +93,15 @@ function form_t.form(layout, data, formtype) 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(); -- cgit v1.2.3