summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO4
-rw-r--r--blabouncer.c3
2 files changed, 2 insertions, 5 deletions
diff --git a/TODO b/TODO
index b5b645a..245ddf1 100644
--- a/TODO
+++ b/TODO
@@ -15,10 +15,6 @@ Allow connecting to a passworded server.
Might need to #include <limits.h> in blabouncer.c to make some operating systems and/or compilers happy.
-Can't update greeting if server changed our nick (e.g. nick protection), then we tried to change it back, but it was now in use (e.g. by services enforcer), so our 433 handling tries to change it again.
-Maybe only do 433 handling if we're not registered yet?
-(Might be fixed by adding missing free() to fix memory leak in this commit - need to re-test.)
-
Support autojoining passworded channels.
Test CTCP.
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