about summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
Diffstat (limited to 'chat.c')
-rw-r--r--chat.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/chat.c b/chat.c
index 0303004..7058802 100644
--- a/chat.c
+++ b/chat.c
@@ -294,14 +294,38 @@ static void handleTopic(char *prefix, char *params) {
 	uiTopic(topic);
 }
 
-static void handle353(char *prefix, char *params) {
+static void handle366(char *prefix, char *params) {
 	(void)prefix;
 	shift(&params);
+	char *chan = shift(&params);
+	clientFmt("WHO %s\r\n", chan);
+}
+
+static char whoBuf[4096];
+static size_t whoLen;
+static void handle352(char *prefix, char *params) {
+	(void)prefix;
+	shift(&params);
+	shift(&params);
+	char *user = shift(&params);
+	shift(&params);
+	shift(&params);
+	char *nick = shift(&params);
+	whoLen += snprintf(
+		&whoBuf[whoLen], sizeof(whoBuf) - whoLen,
+		"%s\3%d%s\3",
+		(whoLen ? ", " : ""), color(user), nick
+	);
+}
+static void handle315(char *prefix, char *params) {
+	(void)prefix;
 	shift(&params);
 	char *chan = shift(&params);
-	char *names = shift(&params);
-	// TODO: Do a WHO instead to get usernames
-	uiFmt("In %s are %s", chan, names);
+	whoLen = 0;
+	uiFmt(
+		"In \3%d%s\3 are %s",
+		color(chan), chan, whoBuf
+	);
 }
 
 static void handlePrivmsg(char *prefix, char *params) {
@@ -324,8 +348,10 @@ static const struct {
 	Handler handler;
 } HANDLERS[] = {
 	{ "001", handle001 },
+	{ "315", handle315 },
 	{ "332", handle332 },
-	{ "353", handle353 },
+	{ "352", handle352 },
+	{ "366", handle366 },
 	{ "JOIN", handleJoin },
 	{ "NOTICE", handleNotice },
 	{ "PART", handlePart },
;id=fbb416f2bdd9dedcbc7b4471af335e2b65331953&follow=1'>Revert "Add client readOnly mode"June McEnroe This reverts commit 34f25ae40a3db9369e9d98b3814f2b93bbc21451. 2017-09-01Remove clientRemove call from clientCastJune McEnroe If an error occurs on a client socket during a broadcast, that client will show up in the kqueue loop with EV_EOF and get removed that way. Tested by sending SIGKILL to a client and watching its cursor disappear. 2017-09-01Add client readOnly modeJune McEnroe 2017-08-31Clean up merge toolJune McEnroe Choose the version with the most recent access if the modify times are the same. 2017-08-31Choose B for tiles with equal modify timesJune McEnroe This way newer access counts and times will be preserved. 2017-08-31Add quick data file merge toolJune McEnroe Hopefully I won't have to use it ever again. 2017-08-30Use only foreground color for selecting spawnJune McEnroe 2017-08-29Add four additional spawnsJune McEnroe 2017-08-28Add respawningJune McEnroe 2017-08-26Move license above includesJune McEnroe Why was it down there? 2017-08-26Snapshot metadataJune McEnroe 2017-08-26Add meta.c to READMEJune McEnroe 2017-08-26Use MakefileJune McEnroe