Only highlight if the entire nick is mentioned, not just individual words.

Closes #1038
This commit is contained in:
Travis Shirk 2005-10-27 05:18:34 +00:00
parent 0e7630fc85
commit af826817fc
1 changed files with 3 additions and 2 deletions

View File

@ -999,9 +999,10 @@ current room topic.') % command, room_jid)
'''checks text to see whether any of the words in muc_highlight_words
appear'''
words = gajim.config.get('muc_highlight_words') + ' ' + nick
words = gajim.config.get('muc_highlight_words').split()
words.append(nick)
for word in words.split():
for word in words:
pattern = r'\b(' + sre.escape(word) + r')+\b'
if sre.search(pattern, text, sre.IGNORECASE | sre.UNICODE):
return True