degesch: simplify highlight detection
This commit is contained in:
parent
4cefa5ab1b
commit
16d10f574b
|
@ -5932,16 +5932,17 @@ irc_is_highlight (struct server *s, const char *message)
|
||||||
formatter_free (&f);
|
formatter_free (&f);
|
||||||
|
|
||||||
// Well, this is rather crude but it should make most users happy.
|
// Well, this is rather crude but it should make most users happy.
|
||||||
// Ideally we could do this at least in proper Unicode.
|
// We could do this in proper Unicode but that's two more conversions per
|
||||||
char *copy = irc_to_utf8 (stripped.str);
|
// message when both the nickname and the message are likely valid UTF-8.
|
||||||
|
char *copy = str_steal (&stripped);
|
||||||
cstr_transform (copy, s->irc_tolower);
|
cstr_transform (copy, s->irc_tolower);
|
||||||
str_free (&stripped);
|
|
||||||
|
|
||||||
char *nick = xstrdup (s->irc_user->nickname);
|
char *nick = xstrdup (s->irc_user->nickname);
|
||||||
cstr_transform (nick, s->irc_tolower);
|
cstr_transform (nick, s->irc_tolower);
|
||||||
|
|
||||||
// Special characters allowed in nicknames by RFC 2812: []\`_^{|} and -
|
// Special characters allowed in nicknames by RFC 2812: []\`_^{|} and -
|
||||||
// Also excluded from the ASCII: common user channel prefixes: +%@&~
|
// 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\"'";
|
const char *delimiters = ",.;:!?()<>/=#$* \t\r\n\v\f\"'";
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|
Loading…
Reference in New Issue