aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-01 18:10:33 +0200
committerKim Alvefur <zash@zash.se>2018-09-01 18:10:33 +0200
commit3d17f4e04ca3fa32cf74ca2fd49f1723cfdd2b16 (patch)
tree0adbfc090994609ce4e9488835b7caa5953eb94b /plugins
parentc8924fdfe4d77d8b48eb41733d33b86b4caf5891 (diff)
downloadprosody-3d17f4e04ca3fa32cf74ca2fd49f1723cfdd2b16.tar.gz
prosody-3d17f4e04ca3fa32cf74ca2fd49f1723cfdd2b16.zip
mod_vcard_legacy: Clear avatars on setting a vcard-temp
Otherwise it is not possible to remove avatars
Diffstat (limited to 'plugins')
-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 5c2625e4..51d84dc3 100644
--- a/plugins/mod_vcard_legacy.lua
+++ b/plugins/mod_vcard_legacy.lua
@@ -134,6 +134,10 @@ module:hook("iq-set/self/vcard-temp:vCard", function (event)
local vcard4 = st.stanza("item", { xmlns = "http://jabber.org/protocol/pubsub", id = "current" })
:tag("vcard", { xmlns = 'urn:ietf:params:xml:ns:vcard-4.0' });
+ if pep_service:purge("urn:xmpp:avatar:metadata", origin.full_jid) then
+ pep_service:publish("urn:xmpp:avatar:data", origin.full_jid);
+ end
+
vcard4:tag("fn"):text_tag("text", vcard_temp:get_child_text("FN")):up();
local N = vcard_temp:get_child("N");