From b815cbf0550ac9df005f32c56652e95ea8b7d8ae Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Fri, 31 Dec 2010 11:23:56 +0000 Subject: fix some stuff, maybe --- src/core.py | 2 +- src/room.py | 3 ++- src/tabs.py | 16 ++++++++-------- src/theme.py | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/core.py b/src/core.py index 449fdef0..ff7d2eb3 100644 --- a/src/core.py +++ b/src/core.py @@ -490,7 +490,7 @@ class Core(object): if not conversation: # We create the conversation with the bare Jid if nothing was found conversation = self.open_conversation_window(jid.bare, False) - conversation.get_room().add_message(body, None, jid.full, False, curses.color_pair(theme.COLOR_REMOTE_USER)) + conversation.get_room().add_message(body, None, jid.full, False, 5) if self.current_tab() is not conversation: conversation.set_color_state(theme.COLOR_TAB_PRIVATE) self.refresh_window() diff --git a/src/room.py b/src/room.py index 94825b3e..972b10a1 100644 --- a/src/room.py +++ b/src/room.py @@ -116,7 +116,8 @@ class Room(TextBuffer): if time: # History messages are colored to be distinguished color = theme.COLOR_INFORMATION_TEXT time = time if time is not None else datetime.now() - message = Message(txt, time, nickname, nick_color or user.color, color, colorized) + nick_color = nick_color or user.color if user else None + message = Message(txt, time, nickname, nick_color, color, colorized) while len(self.messages) > MESSAGE_NB_LIMIT: self.messages.pop(0) self.messages.append(message) diff --git a/src/tabs.py b/src/tabs.py index 6170cb67..c7dddca5 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -36,6 +36,7 @@ import theme import curses import difflib import shlex +import text_buffer from sleekxmpp.xmlstream.stanzabase import JID from config import config @@ -191,21 +192,20 @@ class InfoTab(Tab): The information tab, used to display global informations when using a anonymous account """ - def __init__(self, core, name): + def __init__(self, core): Tab.__init__(self, core) self.tab_win = windows.GlobalInfoBar() - self.text_win = windows.TextWin() + self.info_win = windows.TextWin() + self.core.information_buffer.add_window(self.info_win) self.input = windows.Input() - self.name = name + self.name = "Info" self.color_state = theme.COLOR_TAB_NORMAL self.resize() def resize(self): Tab.resize(self) self.tab_win.resize(1, self.width, self.height-2, 0, self.core.stdscr) - self.tab_win.resize(1, self.width, self.height-2, 0, self.core.stdscr) self.text_win.resize(self.height-2, self.width, 0, 0, self.core.stdscr) - self.text_win.rebuild_everything(self._room) self.input.resize(1, self.width, self.height-1, 0, self.core.stdscr) def refresh(self, tabs, informations, _): @@ -863,12 +863,12 @@ class ConversationTab(ChatTab): The tab containg a normal conversation (not from a MUC) """ def __init__(self, core, jid): - text_buffer = windows.TextBuffer() - ChatTab.__init__(self, core, text_buffer) + txt_buff = text_buffer.TextBuffer() + ChatTab.__init__(self, core, txt_buff) self.color_state = theme.COLOR_TAB_NORMAL self._name = jid # a conversation tab is linked to one specific full jid OR bare jid self.text_win = windows.TextWin() - text_buffer.add_window(self.text_win) + txt_buff.add_window(self.text_win) self.upper_bar = windows.ConversationStatusMessageWin() self.info_header = windows.ConversationInfoWin() self.info_win = windows.TextWin() diff --git a/src/theme.py b/src/theme.py index d483453b..e8878d01 100644 --- a/src/theme.py +++ b/src/theme.py @@ -41,7 +41,7 @@ COLOR_USER_NONE = 0 COLOR_USER_MODERATOR = 1 # nickname colors -COLOR_REMOTE_USER = 23 +COLOR_REMOTE_USER = 5 # The character printed in color (COLOR_STATUS_*) before the nickname # in the user list -- cgit v1.2.3