aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-01-19 22:01:54 +0100
committerKim Alvefur <zash@zash.se>2019-01-19 22:01:54 +0100
commit03acf1ffe1b8abc3b457075bd46be5ac1b491f2c (patch)
tree5362622ab130a3edcf5a76380af3cb3abfbb3aaa /plugins
parent6e624e01c69504684b4afc4e4b1499da2d957c3d (diff)
downloadprosody-03acf1ffe1b8abc3b457075bd46be5ac1b491f2c.tar.gz
prosody-03acf1ffe1b8abc3b457075bd46be5ac1b491f2c.zip
mod_vcard_legacy: Add support for JABBERID - impp/uri conversion
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_vcard_legacy.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua
index ab2c4490..45988fa8 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -105,6 +105,11 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
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 @@ function vcard_to_pep(vcard_temp)
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");