comparison mod_profile/mod_profile.lua @ 3187:7c450c27d4ba

mod_profile: Skip injecting xep153 into presence for sessions with no username s2s or component maybe?
author Kim Alvefur <zash@zash.se>
date Fri, 13 Jul 2018 14:38:40 +0200
parents 1fe5b156d220
children 76a2aca48b4f
comparison
equal deleted inserted replaced
3186:1fe5b156d220 3187:7c450c27d4ba
238 end 238 end
239 239
240 local function inject_xep153(event) 240 local function inject_xep153(event)
241 local origin, stanza = event.origin, event.stanza; 241 local origin, stanza = event.origin, event.stanza;
242 local username = origin.username; 242 local username = origin.username;
243 if not username then return end
243 local pep = pep_plus.get_pep_service(username); 244 local pep = pep_plus.get_pep_service(username);
244 245
245 stanza:remove_children("x", "vcard-temp:x:update"); 246 stanza:remove_children("x", "vcard-temp:x:update");
246 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" }); 247 local x_update = st.stanza("x", { xmlns = "vcard-temp:x:update" });
247 local avatar_hash = pep:get_items("urn:xmpp:avatar:metadata"); 248 local avatar_hash = pep:get_items("urn:xmpp:avatar:metadata");