From c15769685c8cd409b3b3cc21ce43aeb15659141c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 22 Dec 2001 02:28:22 +0000 Subject: [PATCH] Check that the nick doesn't get added twice to nicklist, seems to happen sometimes. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2280 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/core/massjoin.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/irc/core/massjoin.c b/src/irc/core/massjoin.c index 71a46edc..563ec02b 100644 --- a/src/irc/core/massjoin.c +++ b/src/irc/core/massjoin.c @@ -56,6 +56,14 @@ static void event_join(IRC_SERVER_REC *server, const char *data, g_free(params); if (chanrec == NULL) return; + /* check that the nick isn't already in nicklist. seems to happen + sometimes (server desyncs or something?) */ + nickrec = nicklist_find(CHANNEL(chanrec), nick); + if (nickrec != NULL) { + /* destroy the old record */ + nicklist_remove(CHANNEL(chanrec), nickrec); + } + /* add user to nicklist */ nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE); nicklist_set_host(CHANNEL(chanrec), nickrec, address);