summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-04-21 01:33:46 +0200
committerLuke Bratch <luke@bratch.co.uk>2019-04-21 01:33:46 +0200
commit1685960bd0b5686891f94f5e69990512626ffb61 (patch)
treea690dd5569259a78d7b6872fa1adc38aa41058ed /blabouncer.c
parentae325794a162bdcf625f67644976de1623bf371f (diff)
Make already connected clients join channels when JOINing
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c9
1 files changed, 5 insertions, 4 deletions
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;
}