aboutsummaryrefslogtreecommitdiffstats
path: root/util/vcard.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-10 16:47:55 +0200
committerKim Alvefur <zash@zash.se>2014-09-10 16:47:55 +0200
commit534a115ec7aff123fa3358c500554d02b247e4a8 (patch)
treef978ddafe95cb51f0a78439090a71e732416062d /util/vcard.lua
parent08eb887819802af91905b9c51f60c73ee3dbd4ff (diff)
downloadprosody-534a115ec7aff123fa3358c500554d02b247e4a8.tar.gz
prosody-534a115ec7aff123fa3358c500554d02b247e4a8.zip
util.vcard: Turn PHOTO fields into data-uris
Diffstat (limited to 'util/vcard.lua')
-rw-r--r--util/vcard.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/vcard.lua b/util/vcard.lua
index 152b0b2d..8aafa24d 100644
--- a/util/vcard.lua
+++ b/util/vcard.lua
@@ -349,7 +349,11 @@ local function item_to_vcard4(item)
if prop_def == "text" then
t:tag("text"):text(item[1]):up();
elseif prop_def == "uri" then
- t:tag("uri"):text(item[1]):up();
+ if item.ENCODING and item.ENCODING[1] == 'b' then
+ t:tag("uri"):text("data:;base64,"):text(item[1]):up();
+ else
+ t:tag("uri"):text(item[1]):up();
+ end
elseif type(prop_def) == "table" then
if prop_def.values then
for i, v in ipairs(prop_def.values) do