comparison 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
comparison
equal deleted inserted replaced
3191:a1c92d62b861 3192:134e73ebfa5f
247 if not username then return end 247 if not username then return end
248 local pep = pep_plus.get_pep_service(username); 248 local pep = pep_plus.get_pep_service(username);
249 249
250 stanza:remove_children("x", "vcard-temp:x:update"); 250 stanza:remove_children("x", "vcard-temp:x:update");
251 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); 251 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" });
252 local avatar_hash = pep:get_items("urn:xmpp:avatar:metadata"); 252 local ok, avatar_hash = pep:get_items("urn:xmpp:avatar:metadata", true);
253 if avatar_hash then 253 if ok and avatar_hash[1] then
254 x_update:text_tag("photo", avatar_hash); 254 x_update:text_tag("photo", avatar_hash[1]);
255 end 255 end
256 stanza:add_direct_child(x_update); 256 stanza:add_direct_child(x_update);
257 end 257 end
258 258
259 if pep_plus then 259 if pep_plus then