diff options
author | Kim Alvefur <zash@zash.se> | 2018-09-06 23:51:03 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-09-06 23:51:03 +0200 |
commit | 93c99726e32877ec69993b5f88e19b9aafca3b84 (patch) | |
tree | 3468f54d3b318fc149b014a058d4a660efa46e5b | |
parent | d8c32ef0a30dea449b08412eeafac3c6c0f17aa4 (diff) | |
download | prosody-93c99726e32877ec69993b5f88e19b9aafca3b84.tar.gz prosody-93c99726e32877ec69993b5f88e19b9aafca3b84.zip |
mod_vcard_legacy: Return error in case saving avatar fails
-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 |