1
0
mirror of https://github.com/irssi/irssi.git synced 2024-08-25 04:04:18 -04:00

handle an already used nick different from the one we send

This commit is contained in:
Alexandre Morignot 2015-02-10 16:37:41 +01:00
parent e2462b7839
commit dee7825f05

View File

@ -343,7 +343,7 @@ static void event_nick_invalid(IRC_SERVER_REC *server, const char *data)
static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
{
char *str, *cmd;
char *str, *cmd, *params, *nick;
int n;
g_return_if_fail(data != NULL);
@ -353,6 +353,14 @@ static void event_nick_in_use(IRC_SERVER_REC *server, const char *data)
return;
}
params = event_get_params(data, 2, NULL, &nick);
if (g_ascii_strcasecmp(server->nick, nick) != 0) {
/* the server uses a nick different from the one we send */
g_free(server->nick);
server->nick = g_strdup(nick);
}
g_free(params);
/* nick already in use - need to change it .. */
if (g_ascii_strcasecmp(server->nick, server->connrec->nick) == 0 &&
server->connrec->alternate_nick != NULL &&