# HG changeset patch # User Kim Alvefur # Date 1532442184 -7200 # Node ID 134e73ebfa5f0d48088010bd24312df1a4e3f34e # Parent a1c92d62b86164edc8147e162f85a6c818547e1f mod_profile: Correctly add avatar hash :get_items(node, actor, [id]) -> boolean, { ordered key-value table } diff -r a1c92d62b861 -r 134e73ebfa5f mod_profile/mod_profile.lua --- a/mod_profile/mod_profile.lua Tue Jul 24 16:28:02 2018 +0200 +++ b/mod_profile/mod_profile.lua Tue Jul 24 16:23:04 2018 +0200 @@ -249,9 +249,9 @@ stanza:remove_children("x", "vcard-temp:x:update"); local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); - local avatar_hash = pep:get_items("urn:xmpp:avatar:metadata"); - if avatar_hash then - x_update:text_tag("photo", avatar_hash); + 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]); end stanza:add_direct_child(x_update); end