diff --git a/ChangeLog b/ChangeLog index 8a8090d7e..79e75d5bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ Version 0.4.3 (under dev!) * core: fix truncated prefix when filters are toggled (bug #40204) * core: add options to customize default text search in buffers: weechat.look.buffer_search_{case_sensitive|force_default|regex|where} +* irc: fix auto-switch to channel buffer when doing /join channel (without "#") * irc: add option irc.look.notice_welcome_tags * irc: add server option "default_msg_kick" to customize default kick/kickban message (task #12777) diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 03138dede..0741fe7bf 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2133,6 +2133,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, int manual_join, int noswitch) { char *new_args, **channels, **keys, *pos_space, *pos_keys, *pos_channel; + char *channel_name; int i, num_channels, num_keys, length; int time_now; struct t_irc_channel *ptr_channel; @@ -2216,18 +2217,23 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments, strcat (new_args, channels[i]); if (manual_join || noswitch) { - weechat_string_tolower (channels[i]); - if (manual_join) + channel_name = strdup (pos_channel); + if (channel_name) { - weechat_hashtable_set (server->join_manual, - channels[i], - &time_now); - } - if (noswitch) - { - weechat_hashtable_set (server->join_noswitch, - channels[i], - &time_now); + weechat_string_tolower (channel_name); + if (manual_join) + { + weechat_hashtable_set (server->join_manual, + channel_name, + &time_now); + } + if (noswitch) + { + weechat_hashtable_set (server->join_noswitch, + channel_name, + &time_now); + } + free (channel_name); } } if (keys && (i < num_keys))