summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-09-11 17:36:56 -0400
committerJune McEnroe <june@causal.agency>2022-09-11 17:36:56 -0400
commitc5c7067e63225881272f5a4036e51f9ff57135ac (patch)
tree894b4fdb7695e87b83703ad070d40a74c0ed4ac9
parentGenerate /ops from cache (diff)
downloadcatgirl-c5c7067e63225881272f5a4036e51f9ff57135ac.tar.gz
catgirl-c5c7067e63225881272f5a4036e51f9ff57135ac.zip
Remove WHO reply handlers
Diffstat (limited to '')
-rw-r--r--chat.h1
-rw-r--r--handle.c37
2 files changed, 0 insertions, 38 deletions
diff --git a/chat.h b/chat.h
index 198b84e..15c757f 100644
--- a/chat.h
+++ b/chat.h
@@ -291,7 +291,6 @@ enum Reply {
 	ReplyNamesAuto,
 	ReplyTopic,
 	ReplyTopicAuto,
-	ReplyWho,
 	ReplyWhois,
 	ReplyWhowas,
 	ReplyCap,
diff --git a/handle.c b/handle.c
index cebc7e4..bbb3c99 100644
--- a/handle.c
+++ b/handle.c
@@ -600,41 +600,6 @@ static void handleReplyEndOfNames(struct Message *msg) {
 	}
 }
 
-static struct {
-	char buf[1024];
-	char *ptr;
-	char *end;
-} who = {
-	.ptr = who.buf,
-	.end = &who.buf[sizeof(who.buf)],
-};
-
-static void handleReplyWho(struct Message *msg) {
-	require(msg, false, 7);
-	if (who.ptr == who.buf) {
-		who.ptr = seprintf(
-			who.ptr, who.end, "The council of \3%02d%s\3 are ",
-			hash(msg->params[1]), msg->params[1]
-		);
-	}
-	char *prefixes = &msg->params[6][1];
-	if (prefixes[0] == '*') prefixes++;
-	prefixes[strspn(prefixes, network.prefixes)] = '\0';
-	if (!prefixes[0] || prefixes[0] == '+') return;
-	who.ptr = seprintf(
-		who.ptr, who.end, "%s\3%02d%s%s\3%s",
-		(who.ptr[-1] == ' ' ? "" : ", "),
-		hash(msg->params[2]), prefixes, msg->params[5],
-		(msg->params[6][0] == 'H' ? "" : " (away)")
-	);
-}
-
-static void handleReplyEndOfWho(struct Message *msg) {
-	require(msg, false, 2);
-	uiWrite(idFor(msg->params[1]), Warm, tagTime(msg), who.buf);
-	who.ptr = who.buf;
-}
-
 static void handleReplyNoTopic(struct Message *msg) {
 	require(msg, false, 2);
 	uiFormat(
@@ -1392,7 +1357,6 @@ static const struct Handler {
 	{ "312", 0, handleReplyWhoisServer },
 	{ "313", +ReplyWhois, handleReplyWhoisGeneric },
 	{ "314", +ReplyWhowas, handleReplyWhowasUser },
-	{ "315", -ReplyWho, handleReplyEndOfWho },
 	{ "317", +ReplyWhois, handleReplyWhoisIdle },
 	{ "318", -ReplyWhois, handleReplyEndOfWhois },
 	{ "319", +ReplyWhois, handleReplyWhoisChannels },
@@ -1410,7 +1374,6 @@ static const struct Handler {
 	{ "347", -ReplyInvex, NULL },
 	{ "348", +ReplyExcepts, handleReplyExceptList },
 	{ "349", -ReplyExcepts, NULL },
-	{ "352", +ReplyWho, handleReplyWho },
 	{ "353", 0, handleReplyNames },
 	{ "366", 0, handleReplyEndOfNames },
 	{ "367", +ReplyBan, handleReplyBanList },