Our own is ALWAYS white and other nicks are NEVER white. Also reset MAGENTA...

Our own is ALWAYS white and other nicks are NEVER white. Also reset MAGENTA for information messages
parent 94153c49
...@@ -179,10 +179,10 @@ class Gui(object): ...@@ -179,10 +179,10 @@ class Gui(object):
stdscr.keypad(True) stdscr.keypad(True)
curses.init_pair(1, curses.COLOR_WHITE, curses.init_pair(1, curses.COLOR_WHITE,
curses.COLOR_BLUE) curses.COLOR_BLUE)
curses.init_pair(4, curses.COLOR_CYAN, -1) curses.init_pair(2, curses.COLOR_WHITE, -1) # Visitor
curses.init_pair(2, curses.COLOR_RED, -1) # Admin curses.init_pair(3, curses.COLOR_CYAN, -1)
curses.init_pair(3, curses.COLOR_BLUE, -1) # Participant curses.init_pair(4, curses.COLOR_RED, -1) # Admin
curses.init_pair(5, curses.COLOR_WHITE, -1) # Visitor curses.init_pair(5, curses.COLOR_BLUE, -1) # Participant
curses.init_pair(6, curses.COLOR_CYAN, -1) curses.init_pair(6, curses.COLOR_CYAN, -1)
curses.init_pair(7, curses.COLOR_GREEN, -1) curses.init_pair(7, curses.COLOR_GREEN, -1)
curses.init_pair(8, curses.COLOR_MAGENTA, -1) curses.init_pair(8, curses.COLOR_MAGENTA, -1)
...@@ -450,7 +450,6 @@ class Gui(object): ...@@ -450,7 +450,6 @@ class Gui(object):
from_room = stanza.getFrom().getStripped() from_room = stanza.getFrom().getStripped()
room = self.get_room_by_name(from_room) room = self.get_room_by_name(from_room)
if not room: if not room:
# common.debug(':(:(:(:(\n')
return return
else: else:
msg = None msg = None
...@@ -461,11 +460,12 @@ class Gui(object): ...@@ -461,11 +460,12 @@ class Gui(object):
if not room.joined: # user in the room BEFORE us. if not room.joined: # user in the room BEFORE us.
# ignore redondant presence message, see bug #1509 # ignore redondant presence message, see bug #1509
if from_nick not in [user.nick for user in room.users]: if from_nick not in [user.nick for user in room.users]:
room.users.append(User(from_nick, affiliation, show, status, new_user = User(from_nick, affiliation, show, status, role)
role)) room.users.append(new_user)
if from_nick.encode('utf-8') == room.own_nick: if from_nick.encode('utf-8') == room.own_nick:
room.joined = True room.joined = True
self.add_message_to_room(room, _("Your nickname is %s") % (from_nick)) self.add_message_to_room(room, _("Your nickname is %s") % (from_nick))
new_user.color = 2
else: else:
change_nick = stanza.getStatusCode() == '303' change_nick = stanza.getStatusCode() == '303'
kick = stanza.getStatusCode() == '307' kick = stanza.getStatusCode() == '307'
......
...@@ -108,6 +108,9 @@ class Room(object): ...@@ -108,6 +108,9 @@ class Room(object):
self.set_color_state(common.ROOM_STATE_MESSAGE) self.set_color_state(common.ROOM_STATE_MESSAGE)
else: else:
self.set_color_state(common.ROOM_STATE_PRIVATE) self.set_color_state(common.ROOM_STATE_PRIVATE)
if not nickname:
color = 8
else:
color = self.do_highlight(txt, time, nickname) color = self.do_highlight(txt, time, nickname)
if time: # History messages are colored to be distinguished if time: # History messages are colored to be distinguished
color = 8 color = 8
......
...@@ -29,10 +29,7 @@ class User(object): ...@@ -29,10 +29,7 @@ class User(object):
self.last_talked = None self.last_talked = None
self.update(affiliation, show, status, role) self.update(affiliation, show, status, role)
self.change_nick(nick) self.change_nick(nick)
self.color = randrange(2, 10) # assign a random color self.color = randrange(3, 10) # assign a random color
# if randrange(1) == 0:
# self.color = 16
# self.color |= curses.A_BOLD
def update(self, affiliation, show, status, role): def update(self, affiliation, show, status, role):
self.affiliation = affiliation self.affiliation = affiliation
......
...@@ -55,10 +55,10 @@ class UserList(Win): ...@@ -55,10 +55,10 @@ class UserList(Win):
def __init__(self, height, width, y, x, parent_win, visible): def __init__(self, height, width, y, x, parent_win, visible):
Win.__init__(self, height, width, y, x, parent_win) Win.__init__(self, height, width, y, x, parent_win)
self.visible = visible self.visible = visible
self.color_role = {'moderator': 2, self.color_role = {'moderator': 4,
'participant':3, 'participant':5,
'visitor':5, 'visitor':2,
'none':5 'none':3
} }
self.color_show = {'xa':12, self.color_show = {'xa':12,
'None':8, 'None':8,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment