summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-12-10 16:36:18 +0100
committermathieui <mathieui@mathieui.net>2011-12-10 16:36:18 +0100
commit1b30cd09a7937c5ee0021e9eb62b9ccd065916e6 (patch)
treee955cd44c33d903de1f1afddc93d8c4e7857671a
parent3958b112ad304d807041b4d0de18f95e6646896c (diff)
downloadpoezio-1b30cd09a7937c5ee0021e9eb62b9ccd065916e6.tar.gz
poezio-1b30cd09a7937c5ee0021e9eb62b9ccd065916e6.tar.bz2
poezio-1b30cd09a7937c5ee0021e9eb62b9ccd065916e6.tar.xz
poezio-1b30cd09a7937c5ee0021e9eb62b9ccd065916e6.zip
Improve /names command
-rw-r--r--src/tabs.py33
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()