# HG changeset patch # User Kim Alvefur # Date 1530037661 -7200 # Node ID 849c4683eaa037c968b283ab03799ed04fef5378 # Parent 384ef9732b8143cfd0b493e28e4c6400abb7601e mod_pubsub: Handle :set_affiliation errors (not completely in line with the XEP) diff -r 384ef9732b81 -r 849c4683eaa0 plugins/mod_pubsub/pubsub.lib.lua --- 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);