summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 60ccf91..e5f1723 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -102,6 +102,7 @@ struct settings {
char ircserver[HOST_NAME_MAX];
char ircserverport[MAXPORTLEN];
char ircserverpassword[MAXDATASIZE - 5]; // -5 for "PASS "
+ char connectcommand[MAXDATASIZE];
char conffile[PATH_MAX];
char certfile[PATH_MAX];
char keyfile[PATH_MAX];
@@ -863,6 +864,10 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
// 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);
+ }
// If this is a reconnection, JOIN existing channels and catch clients up again
if (ircdstrings->reconnecting) {
// First tell clients if our nick changed
@@ -2547,6 +2552,11 @@ int main(int argc, char *argv[]) {
settings.ircserverpassword[0] = '\0';
}
+ // What is the connect command, if any?
+ if (!getconfstr("connectcommand", settings.conffile, settings.connectcommand)) {
+ settings.connectcommand[0] = '\0';
+ }
+
// Is the base directory set? If not, use the default.
if (!getconfstr("basedir", settings.conffile, settings.basedir)) {
snprintf(settings.basedir, PATH_MAX, "%s/.blabouncer/", getenv("HOME"));