From 735019821777ce559cd2eacef1aaab5fc20a6a81 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Jun 2018 20:27:41 +0200 Subject: mod_pubsub: Handle :set_affiliation errors (not completely in line with the XEP) --- plugins/mod_pubsub/pubsub.lib.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index a6b010fb..8b15fca0 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -507,6 +507,12 @@ function handlers.owner_set_affiliations(origin, stanza, affiliations, service) if affiliation == "none" then affiliation = nil; end local ok, err = service:set_affiliation(node, stanza.attr.from, jid, affiliation); + if not ok then + -- FIXME Incomplete error handling, + -- see XEP 60 8.9.2.4 Multiple Simultaneous Modifications + origin.send(pubsub_error_reply(stanza, err)); + return true; + end end local reply = st.reply(stanza); -- cgit v1.2.3