Software /
code /
prosody
Diff
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 |
line wrap: on
line diff
--- a/plugins/mod_vcard_legacy.lua Mon Jun 01 17:37:54 2020 +0200 +++ b/plugins/mod_vcard_legacy.lua Mon Jun 01 17:55:01 2020 +0200 @@ -276,12 +276,14 @@ pep_service:purge("urn:xmpp:avatar:data", actor); end - local ok, err = pep_service:publish("urn:xmpp:avatar:data", actor, avatar.hash, avatar.data, node_defaults); - if ok then - ok, err = pep_service:publish("urn:xmpp:avatar:metadata", actor, avatar.hash, avatar.meta, node_defaults); - end - if not ok then - return ok, err; + if avatar.data and avatar.meta then + local ok, err = assert(pep_service:publish("urn:xmpp:avatar:data", actor, avatar.hash, avatar.data, node_defaults)); + if ok then + ok, err = assert(pep_service:publish("urn:xmpp:avatar:metadata", actor, avatar.hash, avatar.meta, node_defaults)); + end + if not ok then + return ok, err; + end end end