diff options
author | Timo Sirainen <cras@irssi.org> | 2001-11-04 14:36:51 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-11-04 14:36:51 +0000 |
commit | dd04f35cc65e415e923934b6f72f09d242496f89 (patch) | |
tree | 9d77e6ce4cd67e0a6962d21def68d43ac171ec2c /src/irc | |
parent | c5e2b28d2cdf2dc7ebd74a8858e9c2e8675e0273 (diff) | |
download | irssi-dd04f35cc65e415e923934b6f72f09d242496f89.zip |
Stupid me, remembered wrong how PARAM_FLAG_OPTCHAN worked. This broke /CTCP,
/NCTCP and /NOTICE for non-channel targets. Back to old code, except "*" is
now treated as active target.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1969 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/core/irc-commands.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index 8389fb42..bb7c3448 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -67,10 +67,13 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | - PARAM_FLAG_OPTCHAN, item, &target, &msg)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, + &target, &msg)) return; - if (*target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + if (strcmp(target, "*") == 0) + target = item == NULL ? NULL : item->name; + if (*target == '\0' || *msg == '\0') + cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); g_string_sprintf(tmpstr, "NOTICE %s :%s", target, msg); irc_send_cmd_split(server, tmpstr->str, 2, server->max_msgs_in_cmd); @@ -87,11 +90,13 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server, CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST | - PARAM_FLAG_OPTCHAN, item, + if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST, &target, &ctcpcmd, &ctcpdata)) return; - if (*target == '\0' || *ctcpcmd == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + if (strcmp(target, "*") == 0) + target = item == NULL ? NULL : item->name; + if (*target == '\0' || *ctcpcmd == '\0') + cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); g_strup(ctcpcmd); if (*ctcpdata == '\0') @@ -113,10 +118,12 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server, CMD_IRC_SERVER(server); if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST, - PARAM_FLAG_OPTCHAN, item, &target, &ctcpcmd, &ctcpdata)) return; - if (*target == '\0' || *ctcpcmd == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); + if (strcmp(target, "*") == 0) + target = item == NULL ? NULL : item->name; + if (*target == '\0' || *ctcpcmd == '\0') + cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); g_strup(ctcpcmd); g_string_sprintf(tmpstr, "NOTICE %s :\001%s %s\001", target, ctcpcmd, ctcpdata); |