From 1685960bd0b5686891f94f5e69990512626ffb61 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 21 Apr 2019 01:33:46 +0200 Subject: Make already connected clients join channels when JOINing --- blabouncer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'blabouncer.c') diff --git a/blabouncer.c b/blabouncer.c index 331e4eb..f025912 100644 --- a/blabouncer.c +++ b/blabouncer.c @@ -1,4 +1,4 @@ -// TODO FOR TOMORROW: +// TODO: // - FIGURE OUT WHEN WE'RE REGISTERED (NICK and USER from user are replied to with commands 001, 002, 003, and 004 from the ircd when registration successful) // - int registered = 0; already created to track when this has happened (assuming still want to do it this way) // - handle nick in use @@ -51,10 +51,10 @@ struct channel { char name[MAXCHANLENGTH]; - char topic[MAXDATASIZE]; // TODO - Is there a particular maximum topic length? // TODO - DO WE NEED THIS!? What a twist! + char topic[MAXDATASIZE]; // TODO - Is there a particular maximum topic length? char topicwho[MAXNICKLENGTH]; char topicwhen[11]; // 32-bit unixtime is up to 10 characters (+1 for null char) // TODO - Make this Year 2038 proof - char modes[MAXDATASIZE]; // TODO - Is there a particular maximum modes length? // TODO - DO WE NEED THIS!? What a twist! + char modes[MAXDATASIZE]; // TODO - Is there a particular maximum modes length? char nicks[MAXCHANUSERS][MAXNICKLENGTH]; // TODO - Need to modify this as people leave/join, not just when we first join char namestype[2]; // Single character (@/*/=) (+1 for null char) // TODO - Is this a sensible name? }; @@ -363,7 +363,8 @@ int processircmessage(int *serversockfd, int *clientsockfd, char *str, int sourc createchannel(channels, tokens[2], "TOPIC", "TOPICWHO", "0", "CHANNELMODES", "="); // TODO - Saner way to initialise this since we don't have the variables yet? // - Defaulting to type '=' which is "public" since I don't know what else to guess. - // We processed something so return true + // And then send to all clients + sendtoallclients(clientsockfd, fdmax, arr_clients, str, sourcefd); return 1; } -- cgit v1.2.3