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 "";
aba743d23b830d239dcc33d9ca0745a9ad Signed-off-by: Christian Hesse <mail@eworm.de> 2018-08-28filters: generate anchor links from markdownChristian Hesse This makes the markdown filter generate anchor links for headings. Signed-off-by: Christian Hesse <mail@eworm.de> Tested-by: jean-christophe manciot <actionmystique@gmail.com> 2018-08-03Bump version.Jason A. Donenfeld Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> 2018-08-03clone: fix directory traversalJason A. Donenfeld This was introduced in the initial version of this code, way back when in 2008. $ curl http://127.0.0.1/cgit/repo/objects/?path=../../../../../../../../../etc/passwd root:x:0:0:root:/root:/bin/sh ... Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reported-by: Jann Horn <jannh@google.com> 2018-08-03config: record repo.snapshot-prefix in the per-repo configKonstantin Ryabitsev