diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-10 08:58:52 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-10 08:58:52 +0000 |
commit | 47c7817bc53c790cc1ce7a99f6933cea2c4d7b30 (patch) | |
tree | f8c248252041ae0f036c1de024ac79a33f7ecfd2 /src/irc | |
parent | 9b6d5f7e99b89671b53aa7d3eb44f9e754dad90a (diff) | |
download | irssi-47c7817bc53c790cc1ce7a99f6933cea2c4d7b30.zip |
/MODE +something or /MODE -something assumes that we want to change the
active channel's mode.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@309 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/modes.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/irc/core/modes.c b/src/irc/core/modes.c index 25edbbb9..88d840b4 100644 --- a/src/irc/core/modes.c +++ b/src/irc/core/modes.c @@ -466,10 +466,16 @@ static void cmd_mode(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item) if (server == NULL || !server->connected || !irc_server_check(server)) cmd_return_error(CMDERR_NOT_CONNECTED); - params = cmd_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &mode); + if (*data == '+' || *data == '-') { + target = "*"; + params = mode = g_strdup(data); /* cmd_param_error() wants to free params.. */ + } else { + params = cmd_get_params(data, 2 | PARAM_FLAG_GETREST, &target, &mode); + } + if (strcmp(target, "*") == 0) { if (!irc_item_channel(item)) - cmd_return_error(CMDERR_NOT_JOINED); + cmd_param_error(CMDERR_NOT_JOINED); target = item->name; } |