# HG changeset patch # User Kim Alvefur # Date 1547931714 -3600 # Node ID 8643b784626c08c95216f652b7f0c02e0b1b33bf # Parent 4807535b867338291090273dd36b76a14ce7d866 mod_vcard_legacy: Add support for JABBERID - impp/uri conversion diff -r 4807535b8673 -r 8643b784626c plugins/mod_vcard_legacy.lua --- a/plugins/mod_vcard_legacy.lua Fri Aug 02 08:56:29 2019 +0200 +++ b/plugins/mod_vcard_legacy.lua Sat Jan 19 22:01:54 2019 +0100 @@ -105,6 +105,11 @@ vcard_temp:tag("WORK"):up(); end vcard_temp:up(); + elseif tag.name == "impp" then + local uri = tag:get_child_text("uri"); + if uri and uri:sub(1, 5) == "xmpp:" then + vcard_temp:text_tag("JABBERID", uri:sub(6)) + end end end end @@ -216,6 +221,10 @@ vcard4:text_tag("text", "work"); end vcard4:up():up():up(); + elseif tag.name == "JABBERID" then + vcard4:tag("impp") + :text_tag("uri", "xmpp:" .. tag:get_text()) + :up(); elseif tag.name == "PHOTO" then local avatar_type = tag:get_child_text("TYPE"); local avatar_payload = tag:get_child_text("BINVAL");