summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/client.c b/client.c
index 5970bf2..eaa8555 100644
--- a/client.c
+++ b/client.c
@@ -38,6 +38,7 @@ enum Need {
 struct Client {
 	bool error;
 	struct tls *tls;
+	size_t reader;
 	enum Need need;
 	bool serverTime;
 	char buf[4096];
@@ -112,8 +113,11 @@ static void handleNick(struct Client *client, struct Message msg) {
 }
 
 static void handleUser(struct Client *client, struct Message msg) {
-	(void)msg;
-	// TODO: Identify client by username.
+	if (!msg.params[0]) {
+		client->error = true;
+		return;
+	}
+	client->reader = ringReader(msg.params[0]);
 	client->need &= ~NeedUser;
 	if (!client->need) stateSync(client);
 	if (client->need == NeedPass) passRequired(client);
05ead4d4ad059&follow=1'>Day 10June McEnroe 2020-11-22Day 9, part 2June McEnroe 2020-11-22Day 9June McEnroe I was really sick at the start of the week, okay? 2020-11-22Day 8, part 2June McEnroe 2020-11-22Day 8June McEnroe 2020-11-22Day 7, part 2June McEnroe I don't even know what this is. Don't look at it. 2020-11-22Day 7June McEnroe 2020-11-22Day 6, part 2June McEnroe 2020-11-22Day 6June McEnroe 2020-11-22Day 5, part 2June McEnroe 2020-11-22Day 5June McEnroe 2020-11-22Day 4, part 2June McEnroe That ugly sort map though. 2020-11-22Day 4June McEnroe 2020-11-22Day 3, part 2June McEnroe I am super surprised that worked on the first try. 2020-11-22Day 3, clean upJune McEnroe 2020-11-22Day 3June McEnroe This is fucking awful and I'm angry. 2020-11-22Day 2, part 2June McEnroe 2020-11-22Day 2June McEnroe 2020-11-22Day 1, part 2June McEnroe 2020-11-22Day 1June McEnroe 2020-11-22Move to 2016 directoryJune McEnroe