1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

Make /JOIN -tag #channel and /JOIN #channel<space> switch to that channel (Bugs 13 and 93)

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3292 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Wouter Coekaerts 2004-09-13 16:54:28 +00:00 committed by coekie
parent f84f03706c
commit 2f81d1f160

View File

@ -132,20 +132,28 @@ static void cmd_join(const char *data, SERVER_REC *server)
{ {
WINDOW_REC *window; WINDOW_REC *window;
CHANNEL_REC *channel; CHANNEL_REC *channel;
GHashTable *optlist;
char *channelname;
void *free_arg;
if (strchr(data, ' ') != NULL || strchr(data, ',') != NULL) if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
return; PARAM_FLAG_UNKNOWN_OPTIONS,
"join", &optlist, &channelname))
channel = channel_find(server, data);
if (channel == NULL)
return; return;
/* already joined to channel, set it active */ /* -<server tag> */
window = window_item_window(channel); server = cmd_options_get_server("join", optlist, server);
if (window != active_win)
window_set_active(window); channel = channel_find(server, channelname);
if (channel != NULL) {
/* already joined to channel, set it active */
window = window_item_window(channel);
if (window != active_win)
window_set_active(window);
window_item_set_active(active_win, (WI_ITEM_REC *) channel); window_item_set_active(active_win, (WI_ITEM_REC *) channel);
}
cmd_params_free(free_arg);
} }
static void cmd_wjoin_post(const char *data) static void cmd_wjoin_post(const char *data)