diff options
author | Luke Bratch <luke@bratch.co.uk> | 2023-07-24 20:41:42 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2023-07-24 20:41:42 +0100 |
commit | 3737c7a9750d3035f76128a9c32a32a4226c3939 (patch) | |
tree | abfda659822edaa337c4177da08fc92dd578a69b /message.c | |
parent | 4544c4b56eae07e9da7ed0b4b0329b2989494f0b (diff) |
Include 437 (ERR_UNAVAILRESOURCE) as part of "nick in use" resolution upon connecting.
Diffstat (limited to 'message.c')
-rw-r--r-- | message.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 |