summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2022-03-16 16:12:20 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2022-03-16 16:12:20 +0100
commit60df4ef7aa6e17da329777f9dc66f9bc8ebbe901 (patch)
tree86fc7f3124ffa102032464a164e883e018e92301
parentad610c7dedaa0279550fba6e4267944d00fd834f (diff)
downloadslixmpp-60df4ef7aa6e17da329777f9dc66f9bc8ebbe901.tar.gz
slixmpp-60df4ef7aa6e17da329777f9dc66f9bc8ebbe901.tar.bz2
slixmpp-60df4ef7aa6e17da329777f9dc66f9bc8ebbe901.tar.xz
slixmpp-60df4ef7aa6e17da329777f9dc66f9bc8ebbe901.zip
xep_0045: Require JID when setting outcast affiliation
Found out when reading poezio/poezio#3536. “An admin or owner can ban one or more users from a room. The ban MUST be performed based on the occupant's bare JID.” Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/plugins/xep_0045/muc.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/slixmpp/plugins/xep_0045/muc.py b/slixmpp/plugins/xep_0045/muc.py
index e5971bee..90cb73d7 100644
--- a/slixmpp/plugins/xep_0045/muc.py
+++ b/slixmpp/plugins/xep_0045/muc.py
@@ -493,6 +493,8 @@ class XEP_0045(BasePlugin):
"""
if affiliation not in AFFILIATIONS:
raise ValueError('%s is not a valid affiliation' % affiliation)
+ if affiliation == 'outcast' and not jid:
+ raise ValueError('Outcast affiliation requires a using a jid')
if not any((jid, nick)):
raise ValueError('One of jid or nick must be set')
iq = self.xmpp.make_iq_set(ito=room, ifrom=ifrom)