about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-20 19:22:20 -0400
committerJune McEnroe <june@causal.agency>2021-06-20 19:22:20 -0400
commite2bebca7dcfa0af3e3a39b819595cfad593a49d8 (patch)
treeef38a500fcd7e302c9e9fc703816215d2353c83e /handle.c
parentDon't match actions in notices (diff)
downloadtest-e2bebca7dcfa0af3e3a39b819595cfad593a49d8.tar.gz
test-e2bebca7dcfa0af3e3a39b819595cfad593a49d8.zip
Handle "\1ACTION\1" empty actions
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/handle.c b/handle.c
index bdf6db0..bfe6e8c 100644
--- a/handle.c
+++ b/handle.c
@@ -1163,10 +1163,18 @@ static void handleReplyNowAway(struct Message *msg) {
 }
 
 static bool isAction(struct Message *msg) {
-	if (strncmp(msg->params[1], "\1ACTION ", 8)) return false;
-	msg->params[1] += 8;
+	if (strncmp(msg->params[1], "\1ACTION", 7)) return false;
+	if (msg->params[1][7] == ' ') {
+		msg->params[1] += 8;
+	} else if (msg->params[1][7] == '\1') {
+		msg->params[1] += 7;
+	} else {
+		return false;
+	}
 	size_t len = strlen(msg->params[1]);
-	if (msg->params[1][len - 1] == '\1') msg->params[1][len - 1] = '\0';
+	if (msg->params[1][len - 1] == '\1') {
+		msg->params[1][len - 1] = '\0';
+	}
 	return true;
 }
 
itle='2021-01-12 23:36:03 -0500'>2021-01-12Style causal.agency like bin HTMLJune McEnroe 2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe 2021-01-12Use hilex for up -hJune McEnroe 2021-01-12Use hilex for bin HTMLJune McEnroe 2021-01-12Don't output a pre in hilex by defaultJune McEnroe 2021-01-12Move hilex out of hilex directoryJune McEnroe 2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe 2021-01-12Remove hacky tagging from hilexJune McEnroe 2021-01-12Add htagml -iJune McEnroe 2021-01-12Render tag index in HTMLJune McEnroe 2021-01-12Add htagml -xJune McEnroe 2021-01-12Prevent matching the same tag twiceJune McEnroe 2021-01-12Process htagml file line by lineJune McEnroe 2021-01-12Split fields by tab onlyJune McEnroe 2021-01-12List both Makefile and html.sh under README.7June McEnroe 2021-01-12Add htagml exampleJune McEnroe 2021-01-12Use mandoc and htagml for bin htmlJune McEnroe 2021-01-12Add htagmlJune McEnroe 2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe 2021-01-11Publish "Using vi"June McEnroe 2021-01-11Enable diff.colorMovedJune McEnroe 2021-01-10Set less search case-insensitiveJune McEnroe 2021-01-10Set EXINITJune McEnroe 2021-01-09Add c -t flag to print expression typeJune McEnroe 2021-01-05Update taglineJune McEnroe683a54baa7d&follow=1'>Hide line numbers when rendering mdocJune McEnroe Hack: output an extra <td> after rendering mdoc so that line numbers can be hidden based on there being three. This required splitting source-filter and about-filter since on about pages there is no table. 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe :target persists after you click on something else. 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe NULs in the input cause an infinite loop in htmlEscape, not to mention regexes obviously not working, etc. 2019-12-16Post "cgit setup"June McEnroe