Software / code / prosody
Comparison
util/vcard.lua @ 6308:94c3cf8293a7
util.vcard: Add support for uri types in vcard4
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 09 Jul 2014 08:23:16 +0200 |
| parent | 6265:f8945a030bc6 |
| child | 6400:95241c0f9244 |
comparison
equal
deleted
inserted
replaced
| 6307:b6a47c7a496a | 6308:94c3cf8293a7 |
|---|---|
| 346 local t = st.stanza(typ, { xmlns = xmlns_vcard4 }); | 346 local t = st.stanza(typ, { xmlns = xmlns_vcard4 }); |
| 347 | 347 |
| 348 local prop_def = vCard4_dtd[typ]; | 348 local prop_def = vCard4_dtd[typ]; |
| 349 if prop_def == "text" then | 349 if prop_def == "text" then |
| 350 t:tag("text"):text(item[1]):up(); | 350 t:tag("text"):text(item[1]):up(); |
| 351 elseif prop_def == "uri" then | |
| 352 t:tag("uri"):text(item[1]):up(); | |
| 351 elseif type(prop_def) == "table" then | 353 elseif type(prop_def) == "table" then |
| 352 if prop_def.values then | 354 if prop_def.values then |
| 353 for i, v in ipairs(prop_def.values) do | 355 for i, v in ipairs(prop_def.values) do |
| 354 t:tag(v:lower()):text(item[i] or ""):up(); | 356 t:tag(v:lower()):text(item[i] or ""):up(); |
| 355 end | 357 end |