diff options
author | mathieui <mathieui@mathieui.net> | 2011-12-10 16:36:18 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-01-26 10:05:34 +0100 |
commit | 0d5b96fd8dafcb9727c4d65b2191f0cf56872463 (patch) | |
tree | e955cd44c33d903de1f1afddc93d8c4e7857671a /src | |
parent | ef72674102d506567e00793ef84c0893a79ff654 (diff) | |
download | poezio-0d5b96fd8dafcb9727c4d65b2191f0cf56872463.tar.gz poezio-0d5b96fd8dafcb9727c4d65b2191f0cf56872463.tar.bz2 poezio-0d5b96fd8dafcb9727c4d65b2191f0cf56872463.tar.xz poezio-0d5b96fd8dafcb9727c4d65b2191f0cf56872463.zip |
Improve /names command
Diffstat (limited to 'src')
-rw-r--r-- | src/tabs.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/tabs.py b/src/tabs.py index b1d5bec2..14af2206 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -781,7 +781,12 @@ class MucTab(ChatTab): """ if not self.joined: return - users, visitors, moderators, participants, others = [], [], [], [], [] + color_visitor = get_theme().COLOR_USER_VISITOR[0] + color_other = get_theme().COLOR_USER_NONE[0] + color_moderator = get_theme().COLOR_USER_MODERATOR[0] + color_participant = get_theme().COLOR_USER_PARTICIPANT[0] + color_information = get_theme().COLOR_INFORMATION_TEXT[0] + visitors, moderators, participants, others = [], [], [], [] for user in self.users: if user.role == 'visitor': visitors.append(user.nick) @@ -791,20 +796,18 @@ class MucTab(ChatTab): moderators.append(user.nick) else: others.append(user.nick) - users.append(user.nick) - - message = '' - roles = (('Users', users), ('Visitors', visitors), ('Participants', participants), ('Moderators', moderators), ('Others', others)) - for role in roles: - if role[1]: - role[1].sort() - message += '%s: %i\n ' % (role[0], len(role[1])) - last = role[1].pop() - for item in role[1]: - message += '%s, ' % item - message += '%s\n' % last - - # self.core.add_message_to_text_buffer(room, message) + + message = 'Users: %s \n' % len(self.users) + for moderator in moderators: + message += ' \x19%s}%s\x19o -' % (color_moderator, moderator) + for participant in participants: + message += ' \x19%s}%s\x19o -' % (color_participant, participant) + for visitor in visitors: + message += ' \x19%s}%s\x19o -' % (color_visitor, visitor) + for other in others: + message += ' \x19%s}%s\x19o -' % (color_other, other) + message = message[:-2] + self._text_buffer.add_message(message) self.text_win.refresh() self.input.refresh() |