diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index dd13762fd..609927b3d 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -30,6 +30,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === Bugs fixed +* irc: remove useless rename of channel buffer on JOIN received with different + case (closes #336) * irc: fix completion of commands /allchan and /allpv * relay: fix up/down keys on relay buffer (closes #335) * relay: remove v4-mapped addresses in /help relay.network.allowed_ips diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index c8e5ef5f0..74bc9ba39 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -500,51 +500,6 @@ irc_channel_new (struct t_irc_server *server, int channel_type, return new_channel; } -/* - * Renames a channel. - */ - -void -irc_channel_rename (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *new_name) -{ - struct t_irc_channel *ptr_channel; - char *buffer_name; - const char *short_name; - - /* check if another channel exists with this exact name */ - for (ptr_channel = server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) - { - if ((ptr_channel != channel) - && (strcmp (ptr_channel->name, new_name) == 0)) - { - return; - } - } - - /* rename the channel in buffer */ - if (channel->buffer) - { - short_name = weechat_buffer_get_string (channel->buffer, "short_name"); - if (!short_name || (strcmp (short_name, channel->name) == 0)) - { - /* update the short_name only if it was not changed by the user */ - weechat_buffer_set (channel->buffer, "short_name", new_name); - } - buffer_name = irc_buffer_build_name (server->name, - new_name); - weechat_buffer_set (channel->buffer, "name", buffer_name); - weechat_buffer_set (channel->buffer, "localvar_set_channel", new_name); - } - - /* rename the irc channel */ - if (channel->name) - free (channel->name); - channel->name = strdup (new_name); -} - /* * Adds groups in nicklist for a channel. */ diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h index f6141c84d..08f7f1e9b 100644 --- a/src/plugins/irc/irc-channel.h +++ b/src/plugins/irc/irc-channel.h @@ -88,9 +88,6 @@ extern struct t_irc_channel *irc_channel_new (struct t_irc_server *server, const char *channel_name, int switch_to_channel, int auto_switch); -extern void irc_channel_rename (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *new_name); extern void irc_channel_add_nicklist_groups (struct t_irc_server *server, struct t_irc_channel *channel); extern void irc_channel_set_buffer_title (struct t_irc_channel *channel); diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 25acbc6be..96bffaf2b 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -697,8 +697,6 @@ IRC_PROTOCOL_CALLBACK(join) if (ptr_channel) { ptr_channel->part = 0; - if (strcmp (ptr_channel->name, pos_channel) != 0) - irc_channel_rename (server, ptr_channel, pos_channel); } else {