From 47c7817bc53c790cc1ce7a99f6933cea2c4d7b30 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 10 Jun 2000 08:58:52 +0000 Subject: [PATCH] /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 --- src/irc/core/modes.c | 10 ++++++++-- 1 file 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; }