aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-26 20:27:41 +0200
committerKim Alvefur <zash@zash.se>2018-06-26 20:27:41 +0200
commit735019821777ce559cd2eacef1aaab5fc20a6a81 (patch)
tree99ea34a4622dfcd5004d252707bf4bd1f36e5024
parenta24b2246a68c31def01250217d2b14baedcac112 (diff)
downloadprosody-735019821777ce559cd2eacef1aaab5fc20a6a81.tar.gz
prosody-735019821777ce559cd2eacef1aaab5fc20a6a81.zip
mod_pubsub: Handle :set_affiliation errors (not completely in line with the XEP)
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua6
1 files changed, 6 insertions, 0 deletions
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);