summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-25 19:07:44 -0500
committerJune McEnroe <june@causal.agency>2020-02-25 19:07:44 -0500
commite05150a6fb93de818074a3328bf617291910d606 (patch)
treefa526bad38a56e6aba72ad4d55dfd410f0ab6fd1
parentRequest server-time from the server and filter tags for clients (diff)
downloadpounce-e05150a6fb93de818074a3328bf617291910d606.tar.gz
pounce-e05150a6fb93de818074a3328bf617291910d606.zip
Respond to tagged PINGs correctly
Yikes.
-rw-r--r--server.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/server.c b/server.c
index 1741f14..e8c8880 100644
--- a/server.c
+++ b/server.c
@@ -165,8 +165,13 @@ void serverRecv(void) {
 		if (!crlf) break;
 		crlf[0] = '\0';
 		if (verbose) fprintf(stderr, "\x1B[32m%s\x1B[m\n", line);
-		if (!strncmp(line, "PING ", 5)) {
-			serverFormat("PONG %s\r\n", &line[5]);
+		const char *ping = line;
+		if (ping[0] == '@') {
+			ping += strcspn(ping, " ");
+			if (*ping) ping++;
+		}
+		if (!strncmp(ping, "PING ", 5)) {
+			serverFormat("PONG %s\r\n", &ping[5]);
 		} else {
 			if (stateReady()) ringProduce(line);
 			stateParse(line);
/td>Add photos from May 31June McEnroe 2024-06-09Use monospace on photo pagesJune McEnroe 2024-06-09Put lens and (future) film at the tops of photo pagesJune McEnroe 2024-05-22Remove use of sysexits.hJune McEnroe 2024-05-22Add photo descriptions from 05-03 and 05-06June McEnroe 2024-05-21Fix = precedence in whenJune McEnroep;id=05fc01b2483dfa203a4f905f294b04325e4111eb&follow=1'>Simplify mark, heat, unread trackingJune McEnroe 2020-02-10Update prompt when own nick changesJune McEnroe 2020-02-10Match URLs surrounded by parenthesesJune McEnroe 2020-02-10Fix M-a so it properly cycles back to where it startedJune McEnroe 2020-02-09Add M-lJune McEnroe 2020-02-09Add /whoisJune McEnroe 2020-02-09Add /msgJune McEnroe