summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--src/plugins/irc/irc-channel.c32
-rw-r--r--src/plugins/irc/irc-channel.h3
-rw-r--r--src/plugins/irc/irc-protocol.c3
4 files changed, 41 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b6d8f670f..15745f314 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 931c24f24..302ca69a6 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -592,6 +592,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.
*
* Returns pointer to nick speaking time, NULL if not found.
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index 1e76b06fb..24465be5b 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -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,
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 8cea4fcb8..15ce86d10 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -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))