Fix /affiliation
This commit is contained in:
parent
27a7bfc92c
commit
5ce8105ec6
1 changed files with 6 additions and 7 deletions
13
src/tabs.py
13
src/tabs.py
|
@ -946,19 +946,18 @@ class MucTab(ChatTab):
|
||||||
"""
|
"""
|
||||||
/affiliation <nick> <role>
|
/affiliation <nick> <role>
|
||||||
Changes the affiliation of an user
|
Changes the affiliation of an user
|
||||||
roles can be: none, visitor, participant, moderator
|
affiliations can be: outcast, none, member, admin, owner
|
||||||
"""
|
"""
|
||||||
args = common.shell_split(arg)
|
args = common.shell_split(arg)
|
||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
self.core.command_help('role')
|
self.core.command_help('affiliation')
|
||||||
return
|
return
|
||||||
nick, affiliation = args[0],args[1]
|
nick, affiliation = args[0], args[1].lower()
|
||||||
if len(args) > 2:
|
|
||||||
reason = ' '.join(args[2:])
|
|
||||||
else:
|
|
||||||
reason = ''
|
|
||||||
if not self.joined:
|
if not self.joined:
|
||||||
return
|
return
|
||||||
|
if affiliation not in ('outcast', 'none', 'member', 'admin', 'owner'):
|
||||||
|
self.core.command_help('affiliation')
|
||||||
|
return
|
||||||
if nick in [user.nick for user in self.users]:
|
if nick in [user.nick for user in self.users]:
|
||||||
res = muc.set_user_affiliation(self.core.xmpp, self.get_name(), affiliation, nick=nick)
|
res = muc.set_user_affiliation(self.core.xmpp, self.get_name(), affiliation, nick=nick)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue