plugins/mod_pubsub/pubsub.lib.lua
changeset 8942 849c4683eaa0
parent 8941 384ef9732b81
child 8943 365b16109d95
--- a/plugins/mod_pubsub/pubsub.lib.lua	Tue Jun 26 20:29:33 2018 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Tue Jun 26 20:27:41 2018 +0200
@@ -507,6 +507,12 @@
 		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);