Software / code / prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
| 6147:852bd69ba148 | 6148:7dcd6f124c93 |
|---|---|
| 91 form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up(); | 91 form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up(); |
| 92 end | 92 end |
| 93 end | 93 end |
| 94 end | 94 end |
| 95 end | 95 end |
| 96 | |
| 97 local media = field.media; | |
| 98 if media then | |
| 99 form:tag("media", { xmlns = "urn:xmpp:media-element", height = media.height, width = media.width }); | |
| 100 for _, val in ipairs(media) do | |
| 101 form:tag("uri", { type = val.type }):text(val.uri):up() | |
| 102 end | |
| 103 form:up(); | |
| 104 end | |
| 96 | 105 |
| 97 if field.required then | 106 if field.required then |
| 98 form:tag("required"):up(); | 107 form:tag("required"):up(); |
| 99 end | 108 end |
| 100 | 109 |