# HG changeset patch # User Kim Alvefur # Date 1534842030 -7200 # Node ID 60821653c5a93f5bc5e70eaf490c9922187cfe07 # Parent 5801b5cf8f540cef19ea453cf787f065fbbdeeff mod_profile: Only retrieve the last avatar hash from PEP diff -r 5801b5cf8f54 -r 60821653c5a9 mod_profile/mod_profile.lua --- a/mod_profile/mod_profile.lua Mon Aug 20 23:20:01 2018 +0200 +++ b/mod_profile/mod_profile.lua Tue Aug 21 11:00:30 2018 +0200 @@ -247,9 +247,9 @@ 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_items("urn:xmpp:avatar:metadata", true); - if ok and avatar_hash[1] then - x_update:text_tag("photo", avatar_hash[1]); + local ok, avatar_hash = pep:get_last_item("urn:xmpp:avatar:metadata", true); + if ok and avatar_hash then + x_update:text_tag("photo", avatar_hash); end stanza:add_direct_child(x_update); end