aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_vcard_legacy.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-08-21 17:16:30 +0200
committerKim Alvefur <zash@zash.se>2018-08-21 17:16:30 +0200
commita56ecb418dc45c88862a9b52a2a6c47bd1e64a36 (patch)
tree4bb8bd6f94f4e2851023121cd7ae9545c3ccb1f6 /plugins/mod_vcard_legacy.lua
parente4fdf124a495808ae5e51cc413207214ff6fb130 (diff)
downloadprosody-a56ecb418dc45c88862a9b52a2a6c47bd1e64a36.tar.gz
prosody-a56ecb418dc45c88862a9b52a2a6c47bd1e64a36.zip
mod_vcard_legacy: Respond with old vcard
Diffstat (limited to 'plugins/mod_vcard_legacy.lua')
-rw-r--r--plugins/mod_vcard_legacy.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua
index eedeab56..7a34e68d 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -6,6 +6,8 @@ local mod_pep = module:depends("pep");
local sha1 = require "util.hashes".sha1;
local base64_decode = require "util.encodings".base64.decode;
+local vcards = module:open_store("vcard");
+
module:add_feature("vcard-temp");
module:add_feature("urn:xmpp:pep-vcard-conversion:0");
@@ -93,6 +95,10 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
vcard_temp:up();
end
end
+ else
+ local legacy_vcard = st.deserialize(vcards:get(jid_split(stanza.attr.to) or origin.username));
+ origin.send(st.reply(stanza):add_child(legacy_vcard or vcard_temp));
+ return true;
end
local meta_ok, avatar_meta = pep_service:get_items("urn:xmpp:avatar:metadata", stanza.attr.from);