# HG changeset patch # User Kim Alvefur # Date 1401454554 -7200 # Node ID c3882787ae06e0066eb299729c7a9d5d8a3e3a22 # Parent 295c30e44ba8291e61ee4806b4ccc0a0540f2f91 mod_profile: Purge nodes before publishing new items diff -r 295c30e44ba8 -r c3882787ae06 mod_profile/mod_profile.lua --- a/mod_profile/mod_profile.lua Thu May 29 17:46:42 2014 +0200 +++ b/mod_profile/mod_profile.lua Fri May 30 14:55:54 2014 +0200 @@ -44,11 +44,13 @@ local function update_pep(username, data) local pep = pep_plus.get_pep_service(username.."@"..module.host); if vcard.to_vcard4 then + pep:purge("urn:xmpp:vcard4", true); pep:publish("urn:xmpp:vcard4", true, "", st.stanza("item"):add_child(vcard.to_vcard4(data))); end local nickname = get_item(data, "NICKNAME"); if nickname and nickname[1] then + pep:purge("http://jabber.org/protocol/nick", true); pep:publish("http://jabber.org/protocol/nick", true, "", st.stanza("item") :tag("nick", { xmlns="http://jabber.org/protocol/nick" }):text(nickname[1])); end @@ -58,6 +60,8 @@ local photo_raw = base64.decode(photo[1]); local photo_hash = sha1(photo_raw, true); + pep:purge("urn:xmpp:avatar:metadata", true); + pep:purge("urn:xmpp:avatar:data", true); pep:publish("urn:xmpp:avatar:metadata", true, "", st.stanza("item") :tag("metadata", { xmlns="urn:xmpp:avatar:metadata",