summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-11 18:08:05 -0500
committerJune McEnroe <june@causal.agency>2020-02-11 18:08:05 -0500
commit4d532ec738259a146319183df8a244423563e755 (patch)
treefa58274aeb2c4da16f9578a9701956a4b24b3efb
parentUse time_t for save signature (diff)
downloadcatgirl-4d532ec738259a146319183df8a244423563e755.tar.gz
catgirl-4d532ec738259a146319183df8a244423563e755.zip
Take first two words in colorMentions
This lets phrases like "hi june" get colored, but still doesn't get
carried away.
-rw-r--r--handle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/handle.c b/handle.c
index 95ef50d..40d3f28 100644
--- a/handle.c
+++ b/handle.c
@@ -529,7 +529,10 @@ static bool isMention(const struct Message *msg) {
 
 static const char *colorMentions(size_t id, struct Message *msg) {
 	char *split = strchr(msg->params[1], ':');
-	if (!split) split = strchr(msg->params[1], ' ');
+	if (!split) {
+		split = strchr(msg->params[1], ' ');
+		if (split) split = strchr(&split[1], ' ');
+	}
 	if (!split) split = &msg->params[1][strlen(msg->params[1])];
 	for (char *ch = msg->params[1]; ch < split; ++ch) {
 		if (iscntrl(*ch)) return "";
llJune McEnroe 2021-08-26Add version number generatorJune McEnroe 2021-08-22Add ISC license headerJune McEnroe 2021-08-22Update to Linux man-pages 5.12Štěpán Němec 2021-06-21Add manuals for macOS 11.3June McEnroe 2021-05-08Update to OpenBSD 6.9June McEnroe 2021-04-26Update to Linux man-pages 5.11June McEnroe 2021-04-26Update to FreeBSD 13.0June McEnroe 2021-01-27Completely rewrite how manuals are fetched and installedJune McEnroe Also add section 6 manuals from NetBSD and OpenBSD! 2020-12-14Update to man-pages-posix 2017-aJune McEnroe 2020-12-14Update to OpenBSD 6.8June McEnroe 2020-12-14Update to NetBSD 9.1June McEnroe 2020-12-14Update to man-pages 5.09June McEnroe 2020-12-14Update to FreeBSD 12.2June McEnroe 2020-06-08Update to OpenBSD 6.7June McEnroe 2020-05-04Add hack for macOS to search extra man sectionsJune McEnroe 2020-05-04Don't clear MANSECTJune McEnroe