Changeset

10117:8643b784626c

mod_vcard_legacy: Add support for JABBERID - impp/uri conversion
author Kim Alvefur <zash@zash.se>
date Sat, 19 Jan 2019 22:01:54 +0100
parents 10116:4807535b8673
children 10118:199dae5b6f11
files plugins/mod_vcard_legacy.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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");