Merge branch 'affs-outcast-jid' into 'master'

xep_0045: Require JID when setting outcast affiliation

See merge request poezio/slixmpp!188
This commit is contained in:
Link Mauve 2022-07-12 13:28:02 +02:00
commit b8f301b26f

View file

@ -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)