diff options
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | server_network.c | 10 |
2 files changed, 15 insertions, 0 deletions
@@ -201,6 +201,11 @@ void *client_loop(void *ign) { } } disconnect_client: + if (client_connected) { + SEND(STRING(":1HC000001 QUIT :Ping timeout: -240 seconds\n")); + client_connected = 0; + } + close(client_fd); free(full_msg.data); listen(client_listen_fd, 1); diff --git a/server_network.c b/server_network.c index 0a471bd..901554d 100644 --- a/server_network.c +++ b/server_network.c @@ -450,6 +450,15 @@ int nick_handler(struct string sender, uint64_t argc, struct string *argv) { return 0; } +int fjoin_handler(struct string sender, uint64_t argc, struct string **argv) { + if (argc < 4) { + WRITES(2, STRING("Invalid FJOIN recieved! (Missing parameters")); + return 1; + } + + return 0; +} + int privmsg_handler(struct string sender, uint64_t argc, struct string *argv) { if (argc < 2) { WRITES(2, STRING("Invalid PRIVMSG recieved (Missing parameters)\n")); @@ -588,6 +597,7 @@ int initservernetwork(void) { set_table_index(&server_network_commands, STRING("QUIT"), &quit_handler); set_table_index(&server_network_commands, STRING("KILL"), &kill_handler); set_table_index(&server_network_commands, STRING("NICK"), &nick_handler); + set_table_index(&server_network_commands, STRING("FJOIN"), &fjoin_handler); init_user_commands(); |