aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_vcard_legacy.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-07 01:06:27 +0200
committerKim Alvefur <zash@zash.se>2018-09-07 01:06:27 +0200
commit7032c73db013dd8f9906e21f0ab917058685e738 (patch)
tree1c7b158258b0c40e356c6f6f4eb2763b60c78e66 /plugins/mod_vcard_legacy.lua
parent5823af024e28c22848fca1b0458cf9d06fcd650f (diff)
downloadprosody-7032c73db013dd8f9906e21f0ab917058685e738.tar.gz
prosody-7032c73db013dd8f9906e21f0ab917058685e738.zip
mod_vcard_legacy: Return old vcard if neither vcard4 or avatar available
Diffstat (limited to 'plugins/mod_vcard_legacy.lua')
-rw-r--r--plugins/mod_vcard_legacy.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua
index d6383114..40d81e66 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -129,6 +129,10 @@ module:hook("iq-get/bare/vcard-temp:vCard", function (event)
end
end
+ if not vcard_temp.tags[1] then
+ vcard_temp = st.deserialize(vcards:get(jid_split(stanza.attr.to) or origin.username)) or vcard_temp;
+ end
+
origin.send(st.reply(stanza):add_child(vcard_temp));
return true;
end);