aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-04-22 23:36:26 +0200
committerKim Alvefur <zash@zash.se>2014-04-22 23:36:26 +0200
commit4d6b64f4e1f5eb1c1eccaa72cac817a168c88c40 (patch)
tree58e87156fca8c1809e4c5d0d62fad469a6809f7d /util/dataforms.lua
parent275c5c97a856a534aa6d5f13ad9a10f563361ce2 (diff)
downloadprosody-4d6b64f4e1f5eb1c1eccaa72cac817a168c88c40.tar.gz
prosody-4d6b64f4e1f5eb1c1eccaa72cac817a168c88c40.zip
util.dataforms: Add support for XEP-0221: Data Forms Media Element
Diffstat (limited to 'util/dataforms.lua')
-rw-r--r--util/dataforms.lua9
1 files changed, 9 insertions, 0 deletions
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();