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 /src/plugins/irc/irc-command.c | |
parent | cc8f798237e2d232e0003aa7651e35bee64bb070 (diff) | |
download | weechat-f111abdfc1bce032fff109e5c975affba2521706.zip |
irc: fix auto-switch to channel buffer when doing /join channel (without "#")
Diffstat (limited to 'src/plugins/irc/irc-command.c')
-rw-r--r-- | src/plugins/irc/irc-command.c | 28 |
1 files changed, 17 insertions, 11 deletions
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)) |