summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-11-05 15:00:15 +0100
committermathieui <mathieui@mathieui.net>2012-11-05 15:00:15 +0100
commitbced0daa16369a3d25db532c3f0a9509f4da1160 (patch)
tree1f96350b174b1eb06cc97ce73764a8fcbcb9fa4c /src/tabs.py
parent743ec0f135700d1e358d70b3876b840d3fc1caaf (diff)
downloadpoezio-bced0daa16369a3d25db532c3f0a9509f4da1160.tar.gz
poezio-bced0daa16369a3d25db532c3f0a9509f4da1160.tar.bz2
poezio-bced0daa16369a3d25db532c3f0a9509f4da1160.tar.xz
poezio-bced0daa16369a3d25db532c3f0a9509f4da1160.zip
Fix the completion for /info
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 6a79adce..5e20a75f 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -656,7 +656,7 @@ class MucTab(ChatTab):
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.'), self.completion_recolor)
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.'), 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_info)
self.commands['configure'] = (self.command_configure, _('Usage: /configure\nConfigure: Configure the current room, through a form.'), None)
self.commands['version'] = (self.command_version, _('Usage: /version <jid or nick>\nVersion: Get the software version of the given JID or nick in room (usually its XMPP client and Operating System).'), self.completion_version)
self.commands['names'] = (self.command_names, _('Usage: /names\nNames: Get the list of the users in the room, and the list of the people assuming the different roles.'), None)
@@ -695,6 +695,12 @@ class MucTab(ChatTab):
userlist.extend(contact_list)
return the_input.auto_completion(userlist, '', quotify=False)
+ def completion_info(self, the_input):
+ """Completion for /info"""
+ compare_users = lambda x: x.last_talked
+ userlist = [user.nick for user in sorted(self.users, key=compare_users, reverse=True)]
+ return the_input.auto_completion(userlist, '', quotify=False)
+
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())]