Support for multiple identical nicknames.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1241 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-18 22:46:25 +00:00 committed by cras
commit 6a469c46bb
4 changed files with 173 additions and 8 deletions

View file

@ -389,6 +389,26 @@ void nicklist_update_flags_unique(SERVER_REC *server, void *id,
nicklist_get_same_unique(server, id));
}
/* Specify which nick in channel is ours */
void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick)
{
NICK_REC *first, *next;
channel->ownnick = nick;
/* move our nick in the list to first, makes some things easier
(like handling multiple identical nicks in fe-messages.c) */
first = g_hash_table_lookup(channel->nicks, nick->nick);
if (first->next == NULL)
return;
next = nick->next;
nick->next = first;
first->next = next;
g_hash_table_insert(channel->nicks, nick->nick, nick);
}
static void sig_channel_created(CHANNEL_REC *channel)
{
g_return_if_fail(IS_CHANNEL(channel));

View file

@ -44,6 +44,9 @@ void nicklist_update_flags(SERVER_REC *server, const char *nick,
void nicklist_update_flags_unique(SERVER_REC *server, void *id,
int gone, int ircop);
/* Specify which nick in channel is ours */
void nicklist_set_own(CHANNEL_REC *channel, NICK_REC *nick);
/* Nick record comparision for sort functions */
int nicklist_compare(NICK_REC *p1, NICK_REC *p2);