Software /
code /
verse
Comparison
plugins/vcard.lua @ 316:03ad51d96858
plugins.vcard: Convert textual vCards to XEP-54 format
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 11 Oct 2012 17:00:20 +0200 |
parent | 313:d0d378f15d16 |
child | 395:e86144a4eaa1 |
comparison
equal
deleted
inserted
replaced
315:3742107e2505 | 316:03ad51d96858 |
---|---|
21 function stream:set_vcard(aCard, callback) | 21 function stream:set_vcard(aCard, callback) |
22 local xCard; | 22 local xCard; |
23 if type(aCard) == "table" and aCard.name then | 23 if type(aCard) == "table" and aCard.name then |
24 xCard = aCard; | 24 xCard = aCard; |
25 elseif type(aCard) == "string" then | 25 elseif type(aCard) == "string" then |
26 xCard = vcard.from_text(aCard)[1]; | 26 xCard = vcard.to_xep54(vcard.from_text(aCard)[1]); |
27 elseif type(aCard) == "table" then | 27 elseif type(aCard) == "table" then |
28 xCard = vcard.to_xep54(aCard); | 28 xCard = vcard.to_xep54(aCard); |
29 error("Converting a table to vCard not implemented") | 29 error("Converting a table to vCard not implemented") |
30 end | 30 end |
31 if not xCard then return false end | 31 if not xCard then return false end |