diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-09-14 17:57:07 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-09-14 17:57:07 +0100 |
commit | e1f41810ac85a0d210062ed33f43938dc4b03be4 (patch) | |
tree | 24e100886b063dfe8aa49d6881070b9e238296c4 /message.c | |
parent | e546de81cbecac2b02d29a02d6c6fd7d0785d739 (diff) |
Implement arrays in the configuration file and start using them to allow for multiple connect commands.
Diffstat (limited to 'message.c')
-rw-r--r-- | message.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -89,9 +89,11 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int // Receiving greeting 004 means we're now registered // Request IRCv3 multi-prefix extension so we can more accurately inform new clients about current user prefixes sendtoserver(server_ssl, "CAP REQ multi-prefix", strlen("CAP REQ multi-prefix"), 0, clients, settings); - // Send the connect command, if set - if (settings->connectcommand[0]) { - sendtoserver(server_ssl, settings->connectcommand, strlen(settings->connectcommand), 0, clients, settings); + // Send any configured connect commands + for (int i = 0; i < MAXCONFARR; i++) { + if (settings->connectcommands[i][0]) { + sendtoserver(server_ssl, settings->connectcommands[i], strlen(settings->connectcommands[i]), 0, clients, settings); + } } // If this is a reconnection, JOIN existing channels and catch clients up again if (ircdstate->reconnecting) { |