1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

irc: fix property "short_name" of channel buffer when the joined channel has a different case than the /join command

This commit is contained in:
Sébastien Helleu
2024-06-19 20:52:02 +02:00
parent 1fcf5ac5b3
commit 7cd8312bf9
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -29,6 +29,7 @@
### Fixed
- irc, xfer: fix display of input prompt in IRC private buffers and DCC chat buffers ([#2128](https://github.com/weechat/weechat/issues/2128))
- irc: fix property "short_name" of channel buffer when the joined channel has a different case than the `/join` command
- irc: close /list buffer when the server buffer is closed ([#2121](https://github.com/weechat/weechat/issues/2121))
- irc: clear /list buffer when disconnecting from server ([#2133](https://github.com/weechat/weechat/issues/2133))
- irc: display an explicit message on /list buffer when the list of channels is empty ([#2133](https://github.com/weechat/weechat/issues/2133))
+6 -2
View File
@@ -189,6 +189,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
struct t_hashtable *buffer_props;
int buffer_created, current_buffer_number, buffer_position;
int autojoin_join, manual_join, noswitch;
const char *ptr_short_name;
char str_number[32], *channel_name_lower, *buffer_name, *prompt;
buffer_created = 0;
@@ -217,7 +218,6 @@ irc_channel_create_buffer (struct t_irc_server *server,
NULL, NULL);
if (buffer_props)
{
weechat_hashtable_set (buffer_props, "short_name", channel_name);
weechat_hashtable_set (
buffer_props,
"input_multiline",
@@ -225,6 +225,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
&& weechat_hashtable_has_key (server->cap_list, "draft/multiline")) ?
"1" : "0");
weechat_hashtable_set (buffer_props, "name", buffer_name);
weechat_hashtable_set (buffer_props, "short_name", channel_name);
weechat_hashtable_set (
buffer_props,
"localvar_set_type",
@@ -251,7 +252,10 @@ irc_channel_create_buffer (struct t_irc_server *server,
{
if (!irc_upgrading)
weechat_nicklist_remove_all (ptr_buffer);
weechat_hashtable_remove (buffer_props, "short_name");
/* change short_name only if it's the same or with different case */
ptr_short_name = weechat_buffer_get_string (ptr_buffer, "short_name");
if (irc_server_strcasecmp (server, ptr_short_name, channel_name) != 0)
weechat_hashtable_remove (buffer_props, "short_name");
weechat_hashtable_map (buffer_props, &irc_channel_apply_props, ptr_buffer);
}
else