|
|
|
@ -107,6 +107,9 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject):
|
|
|
|
|
|
|
|
|
|
self.avatars = avatar_cache |
|
|
|
|
self.link_color = '#0000ff' |
|
|
|
|
self.user_color = '#00ff00' |
|
|
|
|
self.tag_color = '#ff0000' |
|
|
|
|
self.group_color = '#ffff00' |
|
|
|
|
self.unread_char = '(o)' |
|
|
|
|
self.favorite_char = '(F)' |
|
|
|
|
self.unfavorite_char = '( )' |
|
|
|
@ -184,6 +187,27 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject):
|
|
|
|
|
message_values['message'] = URL_RE.sub(mask, |
|
|
|
|
message_values['message']) |
|
|
|
|
|
|
|
|
|
# highlight users |
|
|
|
|
user_mask = '(%s)' % (data.user_regexp) |
|
|
|
|
user_re = re.compile(user_mask, re.I) |
|
|
|
|
mask = r'<span foreground="%s">\1</span>' % (self.user_color) |
|
|
|
|
message_values['message'] = user_re.sub(mask, |
|
|
|
|
message_values['message']) |
|
|
|
|
|
|
|
|
|
# highlight groups |
|
|
|
|
group_mask = '(%s)' % (data.group_regexp) |
|
|
|
|
group_re = re.compile(group_mask, re.I) |
|
|
|
|
mask = r'<span foreground="%s">\1</span>' % (self.group_color) |
|
|
|
|
message_values['message'] = group_re.sub(mask, |
|
|
|
|
message_values['message']) |
|
|
|
|
|
|
|
|
|
# highlight tags |
|
|
|
|
tag_mask = '(%s)' % (data.tag_regexp) |
|
|
|
|
tag_re = re.compile(tag_mask, re.I) |
|
|
|
|
mask = r'<span foreground="%s">\1</span>' % (self.tag_color) |
|
|
|
|
message_values['message'] = tag_re.sub(mask, |
|
|
|
|
message_values['message']) |
|
|
|
|
|
|
|
|
|
# use a different highlight for the current user |
|
|
|
|
# TODO: How to handle this with several networks? |
|
|
|
|
#message = re.sub(r'(@'+self.twitter.username+')', |
|
|
|
|