summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-12-15 02:35:52 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-12-15 02:42:30 +0100
commit786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a (patch)
treee3374c15f93c8e71b11f7bf486e8687898532883 /src/tabs.py
parentfb8295c05f5ff154a1826a7056f65a526d7d4dd2 (diff)
downloadpoezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.gz
poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.bz2
poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.tar.xz
poezio-786f0e7222af6a6377e1b2ea1acc8026ce3c0d4a.zip
Introduce a special "reverse" value for the COLOR_HIGHLIGHT_NICK theme option.
If COLOR_HIGHLIGHT_NICK = "reverse", the highlight nick will be in reverse mode. fix #2165
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tabs.py b/src/tabs.py
index f8a6ecac..f604eca2 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1574,26 +1574,26 @@ class MucTab(ChatTab):
"""
Set the tab color and returns the nick color
"""
- color = None
+ highlighted = False
if not time and nickname and nickname != self.own_nick and self.joined:
if self.own_nick.lower() in txt.lower():
if self.state != 'current':
self.state = 'highlight'
- color = get_theme().COLOR_HIGHLIGHT_NICK
+ highlighted = True
else:
highlight_words = config.get_by_tabname('highlight_on', '', self.general_jid, True).split(':')
for word in highlight_words:
if word and word.lower() in txt.lower():
if self.state != 'current':
self.state = 'highlight'
- color = get_theme().COLOR_HIGHLIGHT_NICK
+ highlighted = True
break
- if color:
+ if highlighted:
beep_on = config.get('beep_on', 'highlight private').split()
if 'highlight' in beep_on and 'message' not in beep_on:
if config.get_by_tabname('disable_beep', 'false', self.name, False).lower() != 'true':
curses.beep()
- return color
+ return highlighted
def get_user_by_name(self, nick):
"""
@@ -1628,8 +1628,6 @@ class MucTab(ChatTab):
txt = '\x19%(info_col)s}%(txt)s' % {'txt':txt, 'info_col': get_theme().COLOR_INFORMATION_TEXT[0]}
else: # TODO
highlight = self.do_highlight(txt, time, nickname)
- if highlight:
- nick_color = highlight
time = time or datetime.now()
self._text_buffer.add_message(txt, time, nickname, nick_color, history, user, highlight=highlight, identifier=identifier)
return highlight