From 0c964f63c5e9362d856778b0abf81fdaff004d57 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Mon, 28 Oct 2019 00:39:16 -0400 Subject: Move entire login flow to state and reorganize it --- client.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'client.c') 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]); } -- cgit 1.4.1