Comparison

plugins/mod_vcard_legacy.lua @ 9672:e71484c210fb 0.11

mod_vcard_legacy: Limit injection of XEP-0153 to normal presence (fixes #1252)
author Kim Alvefur <zash@zash.se>
date Sat, 01 Dec 2018 00:11:49 +0100
parent 9520:d6964d16455c
child 9808:00d210deea28
comparison
equal deleted inserted replaced
9665:4790d1b88919 9672:e71484c210fb
272 272
273 local function inject_xep153(event) 273 local function inject_xep153(event)
274 local origin, stanza = event.origin, event.stanza; 274 local origin, stanza = event.origin, event.stanza;
275 local username = origin.username; 275 local username = origin.username;
276 if not username then return end 276 if not username then return end
277 if stanza.attr.type then return end
277 local pep_service = mod_pep.get_pep_service(username); 278 local pep_service = mod_pep.get_pep_service(username);
278 279
279 stanza:remove_children("x", "vcard-temp:x:update"); 280 stanza:remove_children("x", "vcard-temp:x:update");
280 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); 281 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" });
281 local ok, avatar_hash = pep_service:get_last_item("urn:xmpp:avatar:metadata", true); 282 local ok, avatar_hash = pep_service:get_last_item("urn:xmpp:avatar:metadata", true);