1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-04 08:43:13 +02:00

irc: remove useless rename of channel buffer on JOIN received with different case (closes #336)

This bug was introduced by commit 624083f41a.
This commit is contained in:
Sébastien Helleu
2015-02-21 08:35:26 +01:00
parent c9c8625581
commit 770152dea7
4 changed files with 2 additions and 50 deletions
+2
View File
@@ -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
-45
View File
@@ -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.
*/
-3
View File
@@ -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);
-2
View File
@@ -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
{