util.dataforms: Add support for XEP-0221: Data Forms Media Element

This commit is contained in:
Kim Alvefur 2014-04-22 23:36:26 +02:00
parent 70b5195b4f
commit ef460cbd97

View file

@ -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();