summaryrefslogtreecommitdiff
path: root/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'message.c')
-rw-r--r--message.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/message.c b/message.c
index 7067776..3eb35bd 100644
--- a/message.c
+++ b/message.c
@@ -748,10 +748,12 @@ int processservermessage(SSL *server_ssl, char *str, struct client *clients, int
return 1;
}
- // Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) received? See which nick we're on and try another.
- // (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(ircdstate->greeting004)) {
- debugprint(DEBUG_SOME, "Server 432 (ERR_ERRONEUSNICKNAME) or 433 (ERR_NICKNAMEINUSE) found and it is: %s with length %zd! Trying another nick...\n",
+ // Server 432 (ERR_ERRONEUSNICKNAME), 433 (ERR_NICKNAMEINUSE), or 437 (ERR_UNAVAILRESOURCE) received? See which nick we're on and try another.
+ // (But only if we're not already registered with the real IRC server. In particular 437 (ERR_UNAVAILRESOURCE) may be about a channel rather
+ // our nick, but if we're not registered yet then it's probably about our nick.)
+ if ((strncmp(tokens[1], "432", strlen(tokens[1])) == 0 || strncmp(tokens[1], "433", strlen(tokens[1])) == 0 || strncmp(tokens[1], "437", strlen(tokens[1])) == 0)
+ && !strlen(ircdstate->greeting004)) {
+ debugprint(DEBUG_SOME, "Server 432 (ERR_ERRONEUSNICKNAME), 433 (ERR_NICKNAMEINUSE), or 437 (ERR_UNAVAILRESOURCE) found and it is: %s with length %zd! Trying another nick...\n",
tokens[1], strlen(tokens[1]));
// Find the nick (its index in the nicks array) currently selected