Comparison

plugins/mod_vcard_legacy.lua @ 10865:9c27b2385fad

mod_vcard_legacy: Fix publishing vcard without avatar
author Kim Alvefur <zash@zash.se>
date Mon, 01 Jun 2020 17:55:01 +0200
parent 10864:1b657605ea29
child 11944:8b5e646dfaa6
comparison
equal deleted inserted replaced
10864:1b657605ea29 10865:9c27b2385fad
274 274
275 if pep_service:purge("urn:xmpp:avatar:metadata", actor) then 275 if pep_service:purge("urn:xmpp:avatar:metadata", actor) then
276 pep_service:purge("urn:xmpp:avatar:data", actor); 276 pep_service:purge("urn:xmpp:avatar:data", actor);
277 end 277 end
278 278
279 local ok, err = pep_service:publish("urn:xmpp:avatar:data", actor, avatar.hash, avatar.data, node_defaults); 279 if avatar.data and avatar.meta then
280 if ok then 280 local ok, err = assert(pep_service:publish("urn:xmpp:avatar:data", actor, avatar.hash, avatar.data, node_defaults));
281 ok, err = pep_service:publish("urn:xmpp:avatar:metadata", actor, avatar.hash, avatar.meta, node_defaults); 281 if ok then
282 end 282 ok, err = assert(pep_service:publish("urn:xmpp:avatar:metadata", actor, avatar.hash, avatar.meta, node_defaults));
283 if not ok then 283 end
284 return ok, err; 284 if not ok then
285 return ok, err;
286 end
285 end 287 end
286 end 288 end
287 289
288 if vcard4 then 290 if vcard4 then
289 return pep_service:publish("urn:xmpp:vcard4", actor, "current", vcard4, node_defaults); 291 return pep_service:publish("urn:xmpp:vcard4", actor, "current", vcard4, node_defaults);