filter: send the failure response only on PRIVMSG

This commit is contained in:
Ed Kellett 2018-08-14 22:41:24 +01:00
parent 744ac30804
commit d928bc7af3
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -337,9 +337,11 @@ filter_msg_user(void *data_)
unsigned r = match_message("0", s, cmdname[data->msgtype], "0", data->text) |
match_message("1", s, cmdname[data->msgtype], "0", text);
if (r & ACT_DROP) {
sendto_one_numeric(s, ERR_CANNOTSENDTOCHAN,
form_str(ERR_CANNOTSENDTOCHAN),
data->target_p->name);
if (data->msgtype == MESSAGE_TYPE_PRIVMSG) {
sendto_one_numeric(s, ERR_CANNOTSENDTOCHAN,
form_str(ERR_CANNOTSENDTOCHAN),
data->target_p->name);
}
data->approved = 1;
}
if (r & ACT_ALARM) {
@ -373,9 +375,11 @@ filter_msg_channel(void *data_)
unsigned r = match_message("0", s, cmdname[data->msgtype], data->chptr->chname, data->text) |
match_message("1", s, cmdname[data->msgtype], data->chptr->chname, text);
if (r & ACT_DROP) {
sendto_one_numeric(s, ERR_CANNOTSENDTOCHAN,
form_str(ERR_CANNOTSENDTOCHAN),
data->chptr->chname);
if (data->msgtype == MESSAGE_TYPE_PRIVMSG) {
sendto_one_numeric(s, ERR_CANNOTSENDTOCHAN,
form_str(ERR_CANNOTSENDTOCHAN),
data->chptr->chname);
}
data->approved = 1;
}
if (r & ACT_ALARM) {