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);