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:
commit
b8f301b26f
@ -493,6 +493,8 @@ class XEP_0045(BasePlugin):
|
|||||||
"""
|
"""
|
||||||
if affiliation not in AFFILIATIONS:
|
if affiliation not in AFFILIATIONS:
|
||||||
raise ValueError('%s is not a valid affiliation' % affiliation)
|
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)):
|
if not any((jid, nick)):
|
||||||
raise ValueError('One of jid or nick must be set')
|
raise ValueError('One of jid or nick must be set')
|
||||||
iq = self.xmpp.make_iq_set(ito=room, ifrom=ifrom)
|
iq = self.xmpp.make_iq_set(ito=room, ifrom=ifrom)
|
||||||
|
Loading…
Reference in New Issue
Block a user