# HG changeset patch # User Kim Alvefur # Date 1535838358 -7200 # Node ID 3f31e10e8256b454060e3dc356cf5305bfd82c5d # Parent 9a8006f9e983506d4f4eef534919525fe8fbb3c5 mod_vcard_legacy: Add translation of email field diff -r 9a8006f9e983 -r 3f31e10e8256 plugins/mod_vcard_legacy.lua --- a/plugins/mod_vcard_legacy.lua Mon Aug 20 07:36:03 2018 +0200 +++ b/plugins/mod_vcard_legacy.lua Sat Sep 01 23:45:58 2018 +0200 @@ -46,6 +46,19 @@ if text then vcard_temp:text_tag(tag.name:upper(), text); end + elseif tag.name == "email" then + local text = tag:get_child_text("text"); + if text then + vcard_temp:tag("EMAIL") + :text_tag("USERID", text) + :tag("INTERNET"):up(); + if tag:find"parameters/type/text#" == "home" then + vcard_temp:tag("HOME"):up(); + elseif tag:find"parameters/type/text#" == "work" then + vcard_temp:tag("WORK"):up(); + end + vcard_temp:up(); + end end end end