Software /
code /
prosody
Comparison
plugins/mod_vcard_legacy.lua @ 9269:6097dc7d4847
mod_vcard_legacy: Return error in case saving avatar fails
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 06 Sep 2018 23:51:03 +0200 |
parent | 9268:628b99811301 |
child | 9270:b024fae6919e |
comparison
equal
deleted
inserted
replaced
9268:628b99811301 | 9269:6097dc7d4847 |
---|---|
238 | 238 |
239 local avatar_data = st.stanza("item", { id = avatar_hash, xmlns = "http://jabber.org/protocol/pubsub" }) | 239 local avatar_data = st.stanza("item", { id = avatar_hash, xmlns = "http://jabber.org/protocol/pubsub" }) |
240 :tag("data", { xmlns="urn:xmpp:avatar:data" }) | 240 :tag("data", { xmlns="urn:xmpp:avatar:data" }) |
241 :text(avatar_payload); | 241 :text(avatar_payload); |
242 | 242 |
243 if pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data) then | 243 local ok, err = pep_service:publish("urn:xmpp:avatar:data", origin.full_jid, avatar_hash, avatar_data) |
244 pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta); | 244 if ok then |
245 ok, err = pep_service:publish("urn:xmpp:avatar:metadata", origin.full_jid, avatar_hash, avatar_meta); | |
246 end | |
247 if not ok then | |
248 handle_error(origin, stanza, err); | |
249 return true; | |
245 end | 250 end |
246 end | 251 end |
247 end | 252 end |
248 end | 253 end |
249 | 254 |