summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 16:15:34 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 16:15:34 +0100
commit283b258d4e7d2131620eca22e9effc9cb0ede036 (patch)
treef7e1d2f370e629138472992da02ed704b657307a
parent8f826388f0b34b5230c2569ffd3e16a713c4c071 (diff)
downloadpoezio-283b258d4e7d2131620eca22e9effc9cb0ede036.tar.gz
poezio-283b258d4e7d2131620eca22e9effc9cb0ede036.tar.bz2
poezio-283b258d4e7d2131620eca22e9effc9cb0ede036.tar.xz
poezio-283b258d4e7d2131620eca22e9effc9cb0ede036.zip
Completion for /ignore
-rw-r--r--src/tabs.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tabs.py b/src/tabs.py
index a49917c5..a1facb6f 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -472,7 +472,7 @@ class MucTab(ChatTab):
self.key_func['M-u'] = self.scroll_user_list_down
self.key_func['M-y'] = self.scroll_user_list_up
# commands
- self.commands['ignore'] = (self.command_ignore, _("Usage: /ignore <nickname> \nIgnore: Ignore a specified nickname."), None)
+ self.commands['ignore'] = (self.command_ignore, _("Usage: /ignore <nickname> \nIgnore: Ignore a specified nickname."), self.completion_ignore)
self.commands['unignore'] = (self.command_unignore, _("Usage: /unignore <nickname>\nUnignore: Remove the specified nickname from the ignore list."), self.completion_unignore)
self.commands['kick'] = (self.command_kick, _("Usage: /kick <nick> [reason]\nKick: Kick the user with the specified nickname. You also can give an optional reason."), None)
self.commands['role'] = (self.command_role, _("Usage: /role <nick> <role> [reason]\nRole: Set the role of an user. Roles can be: none, visitor, participant, moderator. You also can give an optional reason."), None)
@@ -491,6 +491,11 @@ class MucTab(ChatTab):
self.resize()
self.update_commands()
+ def completion_ignore(self, the_input):
+ userlist = [user.nick for user in self.users]
+ userlist.remove(self.own_nick)
+ return the_input.auto_completion(userlist, '')
+
def scroll_user_list_up(self):
self.user_win.scroll_up()
self.user_win.refresh(self.users)