diff options
-rw-r--r-- | plugins/mod_vcard_legacy.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_vcard_legacy.lua b/plugins/mod_vcard_legacy.lua index f52306f4..c1d402d3 100644 --- a/plugins/mod_vcard_legacy.lua +++ b/plugins/mod_vcard_legacy.lua @@ -240,8 +240,13 @@ module:hook("iq-set/self/vcard-temp:vCard", function (event) :tag("data", { xmlns="urn:xmpp:avatar:data" }) :text(avatar_payload); - if pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data) then - pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta); + local ok, err = pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data) + if ok then + ok, err = pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta); + end + if not ok then + handle_error(origin, stanza, err); + return true; end end end |