summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorAlexandre Morignot <erdnaxeli@cervoi.se>2015-02-10 16:37:41 +0100
committerAlexandre Morignot <erdnaxeli@cervoi.se>2015-02-10 16:37:41 +0100
commitdee7825f05e0e558020fabe2e536e2b5d4df8050 (patch)
treeaae81810529bfa5f0c4a407dee95b20767ef0f5b /src/irc
parente2462b78399af7ce5339d97b0ae87aa280d608c6 (diff)
downloadirssi-dee7825f05e0e558020fabe2e536e2b5d4df8050.zip
handle an already used nick different from the one we send
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-nicklist.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/irc/core/irc-nicklist.c b/src/irc/core/irc-nicklist.c
index 5438509e..a006a3cb 100644
--- a/src/irc/core/irc-nicklist.c
+++ b/src/irc/core/irc-nicklist.c
@@ -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 &&