summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-09-14 17:57:07 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-09-14 17:57:07 +0100
commite1f41810ac85a0d210062ed33f43938dc4b03be4 (patch)
tree24e100886b063dfe8aa49d6881070b9e238296c4 /message.c
parente546de81cbecac2b02d29a02d6c6fd7d0785d739 (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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/message.c b/message.c
index 5cfff91..3887ec9 100644
--- a/message.c
+++ b/message.c
@@ -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) {