Mercurial > prosody-modules
diff mod_profile/mod_profile.lua @ 3192:134e73ebfa5f
mod_profile: Correctly add avatar hash
:get_items(node, actor, [id]) -> boolean, { ordered key-value table }
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 24 Jul 2018 16:23:04 +0200 |
parents | a1c92d62b861 |
children | 92d80b6ce375 |
line wrap: on
line diff
--- 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