summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-27 10:29:43 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-27 10:29:43 +0100
commitff5b7166b8021e4562119852a9682cd09105601f (patch)
treec0cf5772178681a2910125e2116975239c7cb7cf
parent1f4375b77e0f6bd6d898bbfb6d525589ed11ada3 (diff)
Set ircdstrings.mode to null string when initialising and only send our MODE to new clients if irdstrings.mode was set.
-rw-r--r--TODO4
-rw-r--r--blabouncer.c13
2 files changed, 12 insertions, 5 deletions
diff --git a/TODO b/TODO
index 245ddf1..54b889f 100644
--- a/TODO
+++ b/TODO
@@ -22,3 +22,7 @@ Test CTCP.
Reconnect server if we get disconnected for some reason.
Only do CAP multi-prefix negotiation with client if server approved it in the first place.
+
+Change default certfile and keyfile to be basedir/ instead of $HOME.
+
+Connecting to Miau has some sort of corruption and doesn't get channels.
diff --git a/blabouncer.c b/blabouncer.c
index 32ba454..8f2e975 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1440,12 +1440,14 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
sendtoserver(server_ssl, namesreq, strlen(namesreq), 0, clients, settings);
}
- // Send our mode to the client
- if (!snprintf(outgoingmsg, MAXDATASIZE, ":%s MODE %s %s", ircdstrings->ircnick, ircdstrings->ircnick, ircdstrings->mode)) {
- fprintf(stderr, "Error while preparing USER just connected, MODE response!\n");
- exit(1);
+ // Send our mode to the client (if we have one)
+ if (strlen(ircdstrings->mode) > 0) {
+ if (!snprintf(outgoingmsg, MAXDATASIZE, ":%s MODE %s %s", ircdstrings->ircnick, ircdstrings->ircnick, ircdstrings->mode)) {
+ fprintf(stderr, "Error while preparing USER just connected, MODE response!\n");
+ exit(1);
+ }
+ sendtoclient(sourcefd, outgoingmsg, clients, settings, 0);
}
- sendtoclient(sourcefd, outgoingmsg, clients, settings, 0);
// Set the client as registered
clients[arrindex(clients, sourcefd)].registered = 1;
@@ -1858,6 +1860,7 @@ void dochat(int *serversockfd, int *clientsockfd, struct settings *settings) {
ircdstrings.ircnick[0] = '\0';
ircdstrings.ircusername[0] = '\0';
ircdstrings.currentmsg[0] = '\0';
+ ircdstrings.mode[0] = '\0';
// Populate nick and username from our configuration file for now, real IRCd may change them later (TODO - Is this true of username?)
strcpy(ircdstrings.ircnick, settings->ircnick);