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
commit29f7b678108f544063a7f50e35841a638e36ca1c (patch)
tree3468f54d3b318fc149b014a058d4a660efa46e5b
parent309fbca999898f2a0bb28cef4697280fb6d6aac9 (diff)
downloadprosody-29f7b678108f544063a7f50e35841a638e36ca1c.tar.gz
prosody-29f7b678108f544063a7f50e35841a638e36ca1c.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