# HG changeset patch # User Kim Alvefur # Date 1534842106 -7200 # Node ID eec70a863d167c565dba8c001127280d3b30f47c # Parent 60821653c5a93f5bc5e70eaf490c9922187cfe07 mod_profile: Only replace avatar update hash if one is found diff -r 60821653c5a9 -r eec70a863d16 mod_profile/mod_profile.lua --- a/mod_profile/mod_profile.lua Tue Aug 21 11:00:30 2018 +0200 +++ b/mod_profile/mod_profile.lua Tue Aug 21 11:01:46 2018 +0200 @@ -245,13 +245,13 @@ if not username then return end local pep = pep_plus.get_pep_service(username); - stanza:remove_children("x", "vcard-temp:x:update"); - local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); local ok, avatar_hash = pep:get_last_item("urn:xmpp:avatar:metadata", true); if ok and avatar_hash then + stanza:remove_children("x", "vcard-temp:x:update"); + local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); x_update:text_tag("photo", avatar_hash); + stanza:add_direct_child(x_update); end - stanza:add_direct_child(x_update); end if pep_plus then