mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -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:
parent
f84f03706c
commit
2f81d1f160
@ -132,20 +132,28 @@ static void cmd_join(const char *data, SERVER_REC *server)
|
||||
{
|
||||
WINDOW_REC *window;
|
||||
CHANNEL_REC *channel;
|
||||
GHashTable *optlist;
|
||||
char *channelname;
|
||||
void *free_arg;
|
||||
|
||||
if (strchr(data, ' ') != NULL || strchr(data, ',') != NULL)
|
||||
return;
|
||||
|
||||
channel = channel_find(server, data);
|
||||
if (channel == NULL)
|
||||
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS |
|
||||
PARAM_FLAG_UNKNOWN_OPTIONS,
|
||||
"join", &optlist, &channelname))
|
||||
return;
|
||||
|
||||
/* already joined to channel, set it active */
|
||||
window = window_item_window(channel);
|
||||
if (window != active_win)
|
||||
window_set_active(window);
|
||||
/* -<server tag> */
|
||||
server = cmd_options_get_server("join", optlist, server);
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user