summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2012-05-05 17:32:13 +0200
committermathieui <mathieui@mathieui.net>2012-05-05 17:32:13 +0200
commit5670304b173b9c3ab65e316795c1ce4e9fca1d26 (patch)
treeba4a116bbed2a620eebebff234941fef437e3b92
parent88345b1e36f46ee509e6ec3ed80235541de30c38 (diff)
downloadpoezio-5670304b173b9c3ab65e316795c1ce4e9fca1d26.tar.gz
poezio-5670304b173b9c3ab65e316795c1ce4e9fca1d26.tar.bz2
poezio-5670304b173b9c3ab65e316795c1ce4e9fca1d26.tar.xz
poezio-5670304b173b9c3ab65e316795c1ce4e9fca1d26.zip
Use COLOR_OWN_NICK whenever possile (Fixes #2318)
-rw-r--r--src/tabs.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 2b77961a..e9fbda2f 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1524,7 +1524,7 @@ class PrivateTab(ChatTab):
# This lets a plugin insert \x19xxx} colors, that will
# be converted in xhtml.
self.core.events.trigger('private_say', msg, self)
- self.core.add_message_to_text_buffer(self._text_buffer, msg['body'], None, self.core.own_nick or self.own_nick)
+ self.add_message(msg['body'], nickname=self.core.own_nick or self.own_nick, nick_color=get_theme().COLOR_OWN_NICK)
if msg['body'].find('\x19') != -1:
msg['xhtml_im'] = xhtml.poezio_colors_to_html(msg['body'])
msg['body'] = xhtml.clean_text(msg['body'])
@@ -1702,8 +1702,12 @@ class PrivateTab(ChatTab):
def deactivate(self):
self.on = False
- def add_message(self, txt, time=None, nickname=None, forced_user=None):
- self._text_buffer.add_message(txt, time, nickname, None, None, forced_user)
+ def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None):
+ self._text_buffer.add_message(txt, time=time,
+ nickname=nickname,
+ nick_color=nick_color,
+ history=None,
+ user=forced_user)
class RosterInfoTab(Tab):
"""
@@ -2416,7 +2420,8 @@ class ConversationTab(ChatTab):
# This lets a plugin insert \x19xxx} colors, that will
# be converted in xhtml.
self.core.events.trigger('conversation_say', msg, self)
- self.core.add_message_to_text_buffer(self._text_buffer, msg['body'], None, self.core.own_nick)
+ self.add_message(msg['body'], nickname=self.core.own_nick,
+ nick_color=get_theme().COLOR_OWN_NICK)
if msg['body'].find('\x19') != -1:
msg['xhtml_im'] = xhtml.poezio_colors_to_html(msg['body'])
msg['body'] = xhtml.clean_text(msg['body'])
@@ -2579,8 +2584,13 @@ class ConversationTab(ChatTab):
if config.get_by_tabname('send_chat_states', 'true', self.general_jid, True) == 'true':
self.send_chat_state('gone')
- def add_message(self, txt, time=None, nickname=None, forced_user=None):
- self._text_buffer.add_message(txt, time, nickname, None, None, forced_user)
+ def add_message(self, txt, time=None, nickname=None, forced_user=None, nick_color=None):
+ self._text_buffer.add_message(txt, time=time,
+ nickname=nickname,
+ nick_color=nick_color,
+ history=None,
+ user=forced_user)
+
class MucListTab(Tab):
"""