aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-06 23:51:03 +0200
committerKim Alvefur <zash@zash.se>2018-09-06 23:51:03 +0200
commit93c99726e32877ec69993b5f88e19b9aafca3b84 (patch)
tree3468f54d3b318fc149b014a058d4a660efa46e5b
parentd8c32ef0a30dea449b08412eeafac3c6c0f17aa4 (diff)
downloadprosody-93c99726e32877ec69993b5f88e19b9aafca3b84.tar.gz
prosody-93c99726e32877ec69993b5f88e19b9aafca3b84.zip
mod_vcard_legacy: Return error in case saving avatar fails
-rw-r--r--plugins/mod_vcard_legacy.lua9
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