mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 16:53:14 +02:00
irc: fix duplicate nick completion when someone rejoins the channel with same nick but a different case (bug #38841)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
WeeChat ChangeLog
|
||||
=================
|
||||
Sébastien Helleu <flashcode@flashtux.org>
|
||||
v0.4.1-dev, 2013-04-23
|
||||
v0.4.1-dev, 2013-04-28
|
||||
|
||||
|
||||
This document lists all changes for each version.
|
||||
@@ -51,6 +51,8 @@ Version 0.4.1 (under dev!)
|
||||
list with arguments inside), guile >= 2.0 is now required (bug #38350)
|
||||
* guile: fix crash on calls to callbacks during load of script (bug #38343)
|
||||
* guile: fix compilation with guile 2.0
|
||||
* irc: fix duplicate nick completion when someone rejoins the channel with same
|
||||
nick but a different case (bug #38841)
|
||||
* irc: add support of UHNAMES (capability "userhost-in-names") (task #9353)
|
||||
* irc: add tag "irc_nick_back" for messages displayed in private buffer when a
|
||||
nick is back on server (task #12576)
|
||||
|
||||
@@ -591,6 +591,38 @@ irc_channel_nick_speaking_rename (struct t_irc_channel *channel,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Renames a nick speaking on a channel if it is already in list.
|
||||
*/
|
||||
|
||||
void
|
||||
irc_channel_nick_speaking_rename_if_present (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *nick_name)
|
||||
{
|
||||
struct t_weelist_item *ptr_item;
|
||||
int i, j, list_size;
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
if (channel->nicks_speaking[i])
|
||||
{
|
||||
list_size = weechat_list_size (channel->nicks_speaking[i]);
|
||||
for (j = 0; j < list_size; j++)
|
||||
{
|
||||
ptr_item = weechat_list_get (channel->nicks_speaking[i], j);
|
||||
if (ptr_item
|
||||
&& (irc_server_strcasecmp (server,
|
||||
weechat_list_string (ptr_item),
|
||||
nick_name) == 0))
|
||||
{
|
||||
weechat_list_set (ptr_item, nick_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Searches for a nick speaking time on a channel.
|
||||
*
|
||||
|
||||
@@ -108,6 +108,9 @@ extern void irc_channel_nick_speaking_add (struct t_irc_channel *channel,
|
||||
extern void irc_channel_nick_speaking_rename (struct t_irc_channel *channel,
|
||||
const char *old_nick,
|
||||
const char *new_nick);
|
||||
extern void irc_channel_nick_speaking_rename_if_present (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *nick_name);
|
||||
extern struct t_irc_channel_speaking *irc_channel_nick_speaking_time_search (struct t_irc_server *server,
|
||||
struct t_irc_channel *channel,
|
||||
const char *nick_name,
|
||||
|
||||
@@ -568,6 +568,9 @@ IRC_PROTOCOL_CALLBACK(join)
|
||||
/* add nick in channel */
|
||||
ptr_nick = irc_nick_new (server, ptr_channel, nick, address, NULL, 0);
|
||||
|
||||
/* rename the nick if it was in list with a different case */
|
||||
irc_channel_nick_speaking_rename_if_present (server, ptr_channel, nick);
|
||||
|
||||
if (!ignored)
|
||||
{
|
||||
ptr_nick_speaking = ((weechat_config_boolean (irc_config_look_smart_filter))
|
||||
|
||||
Reference in New Issue
Block a user