Fix groupchat highlighting again, for real now.

This commit is contained in:
shteef 2005-11-02 11:00:16 +00:00
parent 5e6766a3a4
commit 3594e582a3
1 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,6 @@ import gtk.glade
import pango
import gobject
import time
import sre
import os
import dialogs
@ -1018,15 +1017,16 @@ current room topic.') % command, room_jid)
appear'''
words = gajim.config.get('muc_highlight_words').split(';')
# Strip empties. ''.split(';') == [''] and would highlight everything.
words = [word for word in words if word]
words.append(nick)
# Strip empties: ''.split(';') == [''] and would highlight everything.
# Also lowercase everything for case insensitive compare.
words = [word.lower() for word in words if word]
text = text.lower()
for word in words:
pattern = r'\b(' + sre.escape(word) + r')+\b'
if sre.search(pattern, text, sre.IGNORECASE | sre.UNICODE):
if word in text:
return True
return False
def kick(self, widget, room_jid, nick):