From 5ce8105ec697938bb1b40744b47f299c74727f9c Mon Sep 17 00:00:00 2001 From: mathieui Date: Sat, 10 Mar 2012 23:43:19 +0100 Subject: Fix /affiliation --- src/tabs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 7a77a0f4..afe77274 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -946,19 +946,18 @@ class MucTab(ChatTab): """ /affiliation 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) if len(args) < 2: - self.core.command_help('role') + self.core.command_help('affiliation') return - nick, affiliation = args[0],args[1] - if len(args) > 2: - reason = ' '.join(args[2:]) - else: - reason = '' + nick, affiliation = args[0], args[1].lower() if not self.joined: 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]: res = muc.set_user_affiliation(self.core.xmpp, self.get_name(), affiliation, nick=nick) else: -- cgit v1.2.3