1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

nick completion: don't add the same nick to completion list twice.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1515 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-05-22 00:38:07 +00:00 committed by cras
parent 47f272da98
commit 3e825325b8

View File

@ -393,7 +393,11 @@ static GList *completion_nicks_nonstrict(CHANNEL_REC *channel,
tnick = g_strconcat(rec->nick, suffix, NULL); tnick = g_strconcat(rec->nick, suffix, NULL);
if (completion_lowercase) if (completion_lowercase)
g_strdown(tnick); g_strdown(tnick);
if (glist_find_icase_string(list, tnick) == NULL)
list = g_list_append(list, tnick); list = g_list_append(list, tnick);
else
g_free(tnick);
} }
} }
@ -429,11 +433,14 @@ static GList *completion_channel_nicks(CHANNEL_REC *channel, const char *nick,
NICK_REC *rec = tmp->data; NICK_REC *rec = tmp->data;
if (g_strncasecmp(rec->nick, nick, len) == 0 && if (g_strncasecmp(rec->nick, nick, len) == 0 &&
glist_find_icase_string(list, rec->nick) == NULL &&
rec != channel->ownnick) { rec != channel->ownnick) {
str = g_strconcat(rec->nick, suffix, NULL); str = g_strconcat(rec->nick, suffix, NULL);
if (completion_lowercase) g_strdown(str); if (completion_lowercase)
g_strdown(str);
if (glist_find_icase_string(list, str) == NULL)
list = g_list_append(list, str); list = g_list_append(list, str);
else
g_free(str);
} }
} }
g_slist_free(nicks); g_slist_free(nicks);