fix some stuff, maybe

parent 3b2d28e6
...@@ -490,7 +490,7 @@ class Core(object): ...@@ -490,7 +490,7 @@ class Core(object):
if not conversation: if not conversation:
# We create the conversation with the bare Jid if nothing was found # We create the conversation with the bare Jid if nothing was found
conversation = self.open_conversation_window(jid.bare, False) 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: if self.current_tab() is not conversation:
conversation.set_color_state(theme.COLOR_TAB_PRIVATE) conversation.set_color_state(theme.COLOR_TAB_PRIVATE)
self.refresh_window() self.refresh_window()
......
...@@ -116,7 +116,8 @@ class Room(TextBuffer): ...@@ -116,7 +116,8 @@ class Room(TextBuffer):
if time: # History messages are colored to be distinguished if time: # History messages are colored to be distinguished
color = theme.COLOR_INFORMATION_TEXT color = theme.COLOR_INFORMATION_TEXT
time = time if time is not None else datetime.now() 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: while len(self.messages) > MESSAGE_NB_LIMIT:
self.messages.pop(0) self.messages.pop(0)
self.messages.append(message) self.messages.append(message)
......
...@@ -36,6 +36,7 @@ import theme ...@@ -36,6 +36,7 @@ import theme
import curses import curses
import difflib import difflib
import shlex import shlex
import text_buffer
from sleekxmpp.xmlstream.stanzabase import JID from sleekxmpp.xmlstream.stanzabase import JID
from config import config from config import config
...@@ -191,21 +192,20 @@ class InfoTab(Tab): ...@@ -191,21 +192,20 @@ class InfoTab(Tab):
The information tab, used to display global informations The information tab, used to display global informations
when using a anonymous account when using a anonymous account
""" """
def __init__(self, core, name): def __init__(self, core):
Tab.__init__(self, core) Tab.__init__(self, core)
self.tab_win = windows.GlobalInfoBar() 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.input = windows.Input()
self.name = name self.name = "Info"
self.color_state = theme.COLOR_TAB_NORMAL self.color_state = theme.COLOR_TAB_NORMAL
self.resize() self.resize()
def resize(self): def resize(self):
Tab.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.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.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) self.input.resize(1, self.width, self.height-1, 0, self.core.stdscr)
def refresh(self, tabs, informations, _): def refresh(self, tabs, informations, _):
...@@ -863,12 +863,12 @@ class ConversationTab(ChatTab): ...@@ -863,12 +863,12 @@ class ConversationTab(ChatTab):
The tab containg a normal conversation (not from a MUC) The tab containg a normal conversation (not from a MUC)
""" """
def __init__(self, core, jid): def __init__(self, core, jid):
text_buffer = windows.TextBuffer() txt_buff = text_buffer.TextBuffer()
ChatTab.__init__(self, core, text_buffer) ChatTab.__init__(self, core, txt_buff)
self.color_state = theme.COLOR_TAB_NORMAL self.color_state = theme.COLOR_TAB_NORMAL
self._name = jid # a conversation tab is linked to one specific full jid OR bare jid self._name = jid # a conversation tab is linked to one specific full jid OR bare jid
self.text_win = windows.TextWin() 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.upper_bar = windows.ConversationStatusMessageWin()
self.info_header = windows.ConversationInfoWin() self.info_header = windows.ConversationInfoWin()
self.info_win = windows.TextWin() self.info_win = windows.TextWin()
......
...@@ -41,7 +41,7 @@ COLOR_USER_NONE = 0 ...@@ -41,7 +41,7 @@ COLOR_USER_NONE = 0
COLOR_USER_MODERATOR = 1 COLOR_USER_MODERATOR = 1
# nickname colors # nickname colors
COLOR_REMOTE_USER = 23 COLOR_REMOTE_USER = 5
# The character printed in color (COLOR_STATUS_*) before the nickname # The character printed in color (COLOR_STATUS_*) before the nickname
# in the user list # in the user list
......
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