summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-13 17:36:16 +0100
committermathieui <mathieui@mathieui.net>2011-11-13 17:36:16 +0100
commit34511797a93497409d828b9fa87621ad5ff63672 (patch)
treeb8de2f75476d0460be95b0ce2efc80cedab2f715 /src/tabs.py
parent6af593f44b2f9326fa18f4c09f8580941b8acc00 (diff)
downloadpoezio-34511797a93497409d828b9fa87621ad5ff63672.tar.gz
poezio-34511797a93497409d828b9fa87621ad5ff63672.tar.bz2
poezio-34511797a93497409d828b9fa87621ad5ff63672.tar.xz
poezio-34511797a93497409d828b9fa87621ad5ff63672.zip
Completion for /nick
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 54207ba9..feb4be37 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -481,7 +481,7 @@ class MucTab(ChatTab):
self.commands['query'] = (self.command_query, _('Usage: /query <nick> [message]\nQuery: Open a private conversation with <nick>. This nick has to be present in the room you\'re currently in. If you specified a message after the nickname, it will immediately be sent to this user.'), self.completion_ignore)
self.commands['part'] = (self.command_part, _("Usage: /part [message]\nPart: Disconnect from a room. You can specify an optional message."), None)
self.commands['close'] = (self.command_close, _("Usage: /close [message]\nClose: Disconnect from a room and close the tab. You can specify an optional message if you are still connected."), None)
- self.commands['nick'] = (self.command_nick, _("Usage: /nick <nickname>\nNick: Change your nickname in the current room."), None)
+ self.commands['nick'] = (self.command_nick, _("Usage: /nick <nickname>\nNick: Change your nickname in the current room."), self.completion_nick)
self.commands['recolor'] = (self.command_recolor, _('Usage: /recolor\nRecolor: Re-assign a color to all participants of the current room, based on the last time they talked. Use this if the participants currently talking have too many identical colors.'), None)
self.commands['cycle'] = (self.command_cycle, _('Usage: /cycle [message]\nCycle: Leave the current room and rejoin it immediately.'), None)
self.commands['info'] = (self.command_info, _('Usage: /info <nickname>\nInfo: Display some information about the user in the MUC: its/his/her role, affiliation, status and status message.'), self.completion_ignore)
@@ -491,6 +491,13 @@ class MucTab(ChatTab):
self.resize()
self.update_commands()
+ def completion_nick(self, the_input):
+ """Completion for /nick"""
+ nicks = [os.environ.get('USER'), config.get('default_nick', ''), self.core.get_bookmark_nickname(self.get_name())]
+ while nicks.count(''):
+ nicks.remove('')
+ return the_input.auto_completion(nicks, '')
+
def completion_ignore(self, the_input):
"""Completion for /ignore"""
userlist = [user.nick for user in self.users]