summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c13
1 files changed, 8 insertions, 5 deletions
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);