Mercurial > prosody-modules
comparison mod_profile/mod_profile.lua @ 3251:60821653c5a9
mod_profile: Only retrieve the last avatar hash from PEP
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Tue, 21 Aug 2018 11:00:30 +0200 |
| parents | 2a54b331f011 |
| children | eec70a863d16 |
comparison
equal
deleted
inserted
replaced
| 3250:5801b5cf8f54 | 3251:60821653c5a9 |
|---|---|
| 245 if not username then return end | 245 if not username then return end |
| 246 local pep = pep_plus.get_pep_service(username); | 246 local pep = pep_plus.get_pep_service(username); |
| 247 | 247 |
| 248 stanza:remove_children("x", "vcard-temp:x:update"); | 248 stanza:remove_children("x", "vcard-temp:x:update"); |
| 249 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); | 249 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); |
| 250 local ok, avatar_hash = pep:get_items("urn:xmpp:avatar:metadata", true); | 250 local ok, avatar_hash = pep:get_last_item("urn:xmpp:avatar:metadata", true); |
| 251 if ok and avatar_hash[1] then | 251 if ok and avatar_hash then |
| 252 x_update:text_tag("photo", avatar_hash[1]); | 252 x_update:text_tag("photo", avatar_hash); |
| 253 end | 253 end |
| 254 stanza:add_direct_child(x_update); | 254 stanza:add_direct_child(x_update); |
| 255 end | 255 end |
| 256 | 256 |
| 257 if pep_plus then | 257 if pep_plus then |
