summaryrefslogtreecommitdiff
path: root/blabouncer.c
diff options
context:
space:
mode:
Diffstat (limited to 'blabouncer.c')
-rw-r--r--blabouncer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/blabouncer.c b/blabouncer.c
index 401b5fd..32ba454 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -1206,7 +1206,8 @@ int processircmessage(SSL *server_ssl, char *str, int source, struct client *cli
}
// Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) received? See which nick we're on and try another.
- if (strncmp(tokens[1], "432", strlen(tokens[1])) == 0 || strncmp(tokens[1], "433", strlen(tokens[1])) == 0) {
+ // (But only if we're not already registered with the real IRC server.)
+ if ((strncmp(tokens[1], "432", strlen(tokens[1])) == 0 || strncmp(tokens[1], "433", strlen(tokens[1])) == 0) && !strlen(ircdstrings->greeting004)) {
printf("Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) found and it is: %s with length %zd! Trying another nick...\n", tokens[1], strlen(tokens[1]));
// Make sure nick3 hasn't already been tried