diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-27 15:08:30 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-10-27 15:08:30 +0100 |
commit | f111abdfc1bce032fff109e5c975affba2521706 (patch) | |
tree | 1744023a2d4811f3ab6188d48d15cc804b1366fd | |
parent | cc8f798237e2d232e0003aa7651e35bee64bb070 (diff) | |
download | weechat-f111abdfc1bce032fff109e5c975affba2521706.zip |
irc: fix auto-switch to channel buffer when doing /join channel (without "#")
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 28 |
2 files changed, 18 insertions, 11 deletions
@@ -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)) |