about summary refs log tree commit diff
path: root/handle.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-15 05:04:43 -0500
committerJune McEnroe <june@causal.agency>2020-02-15 05:04:43 -0500
commitcd341076c06077d33a65c16fa179e3cc02e2e4f4 (patch)
treed840ae74bae5db296a097194ea47ac77c806cce1 /handle.c
parentEnable multi-prefix (diff)
downloadcatgirl-cd341076c06077d33a65c16fa179e3cc02e2e4f4.tar.gz
catgirl-cd341076c06077d33a65c16fa179e3cc02e2e4f4.zip
Show prefixes in NAMES and WHOIS replies
Diffstat (limited to 'handle.c')
-rw-r--r--handle.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/handle.c b/handle.c
index f29d890..6447634 100644
--- a/handle.c
+++ b/handle.c
@@ -348,7 +348,6 @@ static void handleReplyNames(struct Message *msg) {
 	size_t len = 0;
 	while (msg->params[3]) {
 		char *name = strsep(&msg->params[3], " ");
-		name += strspn(name, network.prefixes);
 		char *nick = strsep(&name, "!");
 		char *user = strsep(&name, "@");
 		enum Color color = (user ? hash(user) : Default);
@@ -510,10 +509,10 @@ static void handleReplyWhoisChannels(struct Message *msg) {
 	size_t len = 0;
 	while (msg->params[2]) {
 		char *channel = strsep(&msg->params[2], " ");
-		channel += strspn(channel, network.prefixes);
+		char *name = &channel[strspn(channel, network.prefixes)];
 		int n = snprintf(
 			&buf[len], sizeof(buf) - len,
-			"%s\3%02d%s\3", (len ? ", " : ""), hash(channel), channel
+			"%s\3%02d%s\3", (len ? ", " : ""), hash(name), channel
 		);
 		assert(n > 0 && len + n < sizeof(buf));
 		len += n;
to some genre fiction. 2022-07-26Rewrite glitch from new pngoJune McEnroe 2022-07-26Update Care with time-to-ID and piercingsJune McEnroe 2022-07-26Add -w to upJune McEnroe 2022-07-13Set push.autoSetupRemoteJune McEnroe 2022-07-08Remove TOURJune McEnroe There is not that much distinct stuff here anymore. 2022-07-03Add The Bone Shard EmperorJune McEnroe Suffers a little bit from middle book but I really enjoyed it. Read it faster than the first one too, despite its length. 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe Mixed bag like most collections of short stories. Some of them are pretty good. The author of the worst written story also has the worst written bio. 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe Absolutely indiscriminately. 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe