From 43323fd24cc9329b4e6cc6de952ec6e9b924c5f7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 20 Feb 2001 00:33:51 +0000 Subject: [PATCH] multi identical nick fixes git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1263 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/fe-messages.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index 20f6c7e2..e8435414 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -501,14 +501,9 @@ static void sig_message_topic(SERVER_REC *server, const char *channel, static int printnick_exists(NICK_REC *first, NICK_REC *ignore, const char *nick) { - char *str; - while (first != NULL) { - if (first != ignore) { - str = g_hash_table_lookup(printnicks, first->nick); - if (str != NULL && strcmp(str, nick) == 0) - return TRUE; - } + if (first != ignore && strcmp(first->nick, nick) == 0) + return TRUE; first = first->next; } @@ -556,7 +551,13 @@ static void sig_nicklist_new(CHANNEL_REC *channel, NICK_REC *nick) static void sig_nicklist_remove(CHANNEL_REC *channel, NICK_REC *nick) { - g_hash_table_remove(printnicks, nick); + char *nickname; + + nickname = g_hash_table_lookup(printnicks, nick); + if (nickname != NULL) { + g_free(nickname); + g_hash_table_remove(printnicks, nick); + } } static void sig_nicklist_changed(CHANNEL_REC *channel, NICK_REC *nick)