summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-09-25 14:06:24 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-09-25 14:11:30 +0200
commit16d10f574bca429b872b8c2f055a127a9fc9a1ba (patch)
tree4b5beb1e23f480cb48dd3b5441a10a60c2468ec7 /degesch.c
parent4cefa5ab1b5c89583d66c466bea00bc58c8dddfd (diff)
downloadxK-16d10f574bca429b872b8c2f055a127a9fc9a1ba.tar.gz
xK-16d10f574bca429b872b8c2f055a127a9fc9a1ba.tar.xz
xK-16d10f574bca429b872b8c2f055a127a9fc9a1ba.zip
degesch: simplify highlight detection
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/degesch.c b/degesch.c
index 9d57abb..a06ef24 100644
--- a/degesch.c
+++ b/degesch.c
@@ -5932,16 +5932,17 @@ irc_is_highlight (struct server *s, const char *message)
formatter_free (&f);
// Well, this is rather crude but it should make most users happy.
- // Ideally we could do this at least in proper Unicode.
- char *copy = irc_to_utf8 (stripped.str);
+ // We could do this in proper Unicode but that's two more conversions per
+ // message when both the nickname and the message are likely valid UTF-8.
+ char *copy = str_steal (&stripped);
cstr_transform (copy, s->irc_tolower);
- str_free (&stripped);
char *nick = xstrdup (s->irc_user->nickname);
cstr_transform (nick, s->irc_tolower);
// Special characters allowed in nicknames by RFC 2812: []\`_^{|} and -
// Also excluded from the ASCII: common user channel prefixes: +%@&~
+ // XXX: why did I exclude those? It won't match when newbies use them.
const char *delimiters = ",.;:!?()<>/=#$* \t\r\n\v\f\"'";
bool result = false;