aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat-text-view.h
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2012-01-18 23:41:07 +0800
committerWill Thompson <will@willthompson.co.uk>2012-01-19 01:47:21 +0800
commitaded85c91fb409bafb06492ddb85aa1224178d4c (patch)
tree374c7de2868580c498358ed49e7ec50ce6e5e51a /libempathy-gtk/empathy-chat-text-view.h
parent449c56b28d41ddbb13e8d206b9d1fbabca7e2ec6 (diff)
downloadgsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar.gz
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar.bz2
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar.lz
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar.xz
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.tar.zst
gsoc2013-empathy-aded85c91fb409bafb06492ddb85aa1224178d4c.zip
Use /\b<nickname>\b/ to decide whether to highlight
The current highlighting code finds the first occurrence of the nickname, then checks whether the characters before or after are a space, a comma, a colon or a full stop (or the start or end of the string). This means that someone saying “no! That's wjt’s coffee!” didn’t highlight me, because the apostrophe isn't in the whitelist. It also means that saying “borrow some Sudafed from daf” would not highlight daf, since the first match is in the middle of a word. We’re trying to check whether the nickname occurs as a complete word within the message. The regex metacharacter \b matches word boundaries, so /\b<nickname>\b/ is what we actually want. It gets the above cases right, including Unicode punctuation. https://bugzilla.gnome.org/show_bug.cgi?id=591667
Diffstat (limited to 'libempathy-gtk/empathy-chat-text-view.h')
0 files changed, 0 insertions, 0 deletions