summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-irc-commands.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-04 14:36:51 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-04 14:36:51 +0000
commitdd04f35cc65e415e923934b6f72f09d242496f89 (patch)
tree9d77e6ce4cd67e0a6962d21def68d43ac171ec2c /src/fe-common/irc/fe-irc-commands.c
parentc5e2b28d2cdf2dc7ebd74a8858e9c2e8675e0273 (diff)
downloadirssi-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/fe-common/irc/fe-irc-commands.c')
-rw-r--r--src/fe-common/irc/fe-irc-commands.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index c05bce3e..c9d3e7af 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -98,9 +98,12 @@ 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 (strcmp(target, "*") == 0)
+ target = item == NULL ? NULL : item->name;
+
if (*target == '\0' || *msg == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
@@ -117,10 +120,11 @@ 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 (strcmp(target, "*") == 0)
+ target = item == NULL ? NULL : item->name;
if (*target == '\0' || *ctcpcmd == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
@@ -147,9 +151,11 @@ static void cmd_nctcp(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, &text))
+ if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
+ &target, &text))
return;
+ if (strcmp(target, "*") == 0)
+ target = item == NULL ? NULL : item->name;
if (*target == '\0' || *text == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);