summary refs log tree commit diff
path: root/client.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-10-28 00:39:16 -0400
committerJune McEnroe <june@causal.agency>2019-10-28 00:39:16 -0400
commit0c964f63c5e9362d856778b0abf81fdaff004d57 (patch)
treec356a244640731ba6e39137bbb3e90e6c75fc8c6 /client.c
parentWait for SASL success before sending CAP END (diff)
downloadpounce-0c964f63c5e9362d856778b0abf81fdaff004d57.tar.gz
pounce-0c964f63c5e9362d856778b0abf81fdaff004d57.zip
Move entire login flow to state and reorganize it
Diffstat (limited to '')
-rw-r--r--client.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/client.c b/client.c
index 2b075ec..3ed8a81 100644
--- a/client.c
+++ b/client.c
@@ -173,17 +173,14 @@ static void handleQuit(struct Client *client, struct Message *msg) {
 
 static void handlePrivmsg(struct Client *client, struct Message *msg) {
 	if (!msg->params[0] || !msg->params[1]) return;
-	// FIXME: Check against ISUPPORT CHANTYPES?
-	if (msg->params[0][0] == '#') {
-		char line[1024];
-		snprintf(
-			line, sizeof(line), ":%s %s %s :%s",
-			stateSelf(), msg->cmd, msg->params[0], msg->params[1]
-		);
-		size_t diff = ringDiff(client->consumer);
-		ringProduce(line);
-		if (!diff) ringConsume(NULL, client->consumer);
-	}
+	char line[1024];
+	snprintf(
+		line, sizeof(line), ":%s %s %s :%s",
+		stateEcho(), msg->cmd, msg->params[0], msg->params[1]
+	);
+	size_t diff = ringDiff(client->consumer);
+	ringProduce(line);
+	if (!diff) ringConsume(NULL, client->consumer);
 	serverFormat("%s %s :%s\r\n", msg->cmd, msg->params[0], msg->params[1]);
 }