From e69f081127ce7ae9190a56a8f5ac5856b2351733 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 3 Nov 2001 18:36:40 +0000 Subject: [PATCH] * works now as active channel with /NOTICE, /CTCP and /NCTCP. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1967 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-irc-commands.c | 20 +++++++++++-------- src/irc/core/irc-commands.c | 31 +++++++++++++++++++---------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index dd100e39..c05bce3e 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -90,15 +90,16 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server) cmd_params_free(free_arg); } -static void cmd_notice(const char *data, IRC_SERVER_REC *server) +static void cmd_notice(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *msg; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, - &target, &msg)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | + PARAM_FLAG_OPTCHAN, item, &target, &msg)) return; if (*target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -108,14 +109,16 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server) cmd_params_free(free_arg); } -static void cmd_ctcp(const char *data, IRC_SERVER_REC *server) +static void cmd_ctcp(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *ctcpcmd, *ctcpdata; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST, + if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST | + PARAM_FLAG_OPTCHAN, item, &target, &ctcpcmd, &ctcpdata)) return; if (*target == '\0' || *ctcpcmd == '\0') @@ -136,15 +139,16 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server) cmd_params_free(free_arg); } -static void cmd_nctcp(const char *data, IRC_SERVER_REC *server) +static void cmd_nctcp(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *text; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, - &target, &text)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | + PARAM_FLAG_OPTCHAN, item, &target, &text)) return; if (*target == '\0' || *text == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c index e8d3a043..8389fb42 100644 --- a/src/irc/core/irc-commands.c +++ b/src/irc/core/irc-commands.c @@ -59,14 +59,16 @@ static GString *tmpstr; static int knockout_tag; /* SYNTAX: NOTICE */ -static void cmd_notice(const char *data, IRC_SERVER_REC *server) +static void cmd_notice(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *msg; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST, &target, &msg)) + if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST | + PARAM_FLAG_OPTCHAN, item, &target, &msg)) return; if (*target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -77,14 +79,17 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server) } /* SYNTAX: CTCP [] */ -static void cmd_ctcp(const char *data, IRC_SERVER_REC *server) +static void cmd_ctcp(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *ctcpcmd, *ctcpdata; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST, &target, &ctcpcmd, &ctcpdata)) + 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); @@ -99,14 +104,17 @@ static void cmd_ctcp(const char *data, IRC_SERVER_REC *server) } /* SYNTAX: NCTCP [] */ -static void cmd_nctcp(const char *data, IRC_SERVER_REC *server) +static void cmd_nctcp(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *target, *ctcpcmd, *ctcpdata; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST, &target, &ctcpcmd, &ctcpdata)) + 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); @@ -118,14 +126,16 @@ static void cmd_nctcp(const char *data, IRC_SERVER_REC *server) } /* SYNTAX: PART [] [] */ -static void cmd_part(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) +static void cmd_part(const char *data, IRC_SERVER_REC *server, + WI_ITEM_REC *item) { char *channame, *msg; void *free_arg; CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST, item, &channame, &msg)) + if (!cmd_get_params(data, &free_arg, 2 | + PARAM_FLAG_GETREST, item, &channame, &msg)) return; if (*channame == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); @@ -148,8 +158,9 @@ static void cmd_kick(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item CMD_IRC_SERVER(server); - if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_OPTCHAN | PARAM_FLAG_GETREST, - item, &channame, &nicks, &reason)) + if (!cmd_get_params(data, &free_arg, 3 | PARAM_FLAG_GETREST | + PARAM_FLAG_OPTCHAN, item, + &channame, &nicks, &reason)) return; if (*channame == '\0' || *nicks == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);