mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 05:37:39 +03:00
mod_vcard_legacy: Fix publishing vcard without avatar
This commit is contained in:
parent
cd40d2a630
commit
a78297bb6c
1 changed files with 8 additions and 6 deletions
|
@ -276,12 +276,14 @@ function save_to_pep(pep_service, actor, vcard4, avatar)
|
|||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue