Apply cmode C to replies (#328)

This commit is contained in:
Eric Mertens 2022-04-14 13:14:12 -07:00 committed by GitHub
parent ba95896969
commit b2fa28dd95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,10 +51,12 @@ chm_noctcp_process(void *data_)
{
hook_data_privmsg_channel *data = data_;
/* don't waste CPU if message is already blocked */
if (data->approved || data->msgtype == MESSAGE_TYPE_NOTICE)
if (data->approved)
return;
if (*data->text == '\001' && rb_strncasecmp(data->text + 1, "ACTION ", 7) && data->chptr->mode.mode & mode_noctcp)
if (*data->text == '\001' &&
data->chptr->mode.mode & mode_noctcp &&
!(data->msgtype == MESSAGE_TYPE_PRIVMSG && !rb_strncasecmp(data->text + 1, "ACTION ", 7)))
{
sendto_one_numeric(data->source_p, ERR_CANNOTSENDTOCHAN, form_str(ERR_CANNOTSENDTOCHAN), data->chptr->chname);
data->approved = ERR_CANNOTSENDTOCHAN;