diff --git a/help/opers/cmode b/help/opers/cmode index 8594325..c3f84b0 100644 --- a/help/opers/cmode +++ b/help/opers/cmode @@ -28,6 +28,8 @@ NO PARAMETERS: (however, new forwards can still be set subject to +F). +C - Disable CTCP. All CTCP messages to the channel, except ACTION, are disallowed. + +D - Disable CTCP ACTION. All CTCP ACTIONs to the channel will + be blocked. +T - Disable notice. All notices to the channel are disallowed. WITH PARAMETERS: diff --git a/include/channel.h b/include/channel.h index d9c46e2..6aa72ed 100644 --- a/include/channel.h +++ b/include/channel.h @@ -173,6 +173,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p, #define MODE_DISFORWARD 0x2000 /* disable channel forwarding */ #define MODE_NOCTCP 0x8000 /* Block CTCPs directed to this channel */ #define MODE_NONOTICE 0x16000 /* Block notices directed to this channel */ +#define MODE_NOACTION 0x32000 /* Block CTCP ACTION directed to this channel */ #define CHFL_BAN 0x10000000 /* ban channel flag */ #define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */ diff --git a/modules/core/m_message.c b/modules/core/m_message.c index c94a1b3..b4d8d40 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -519,6 +519,13 @@ msg_channel(int p_or_n, const char *command, form_str(ERR_CANNOTSENDTOCHAN), chptr->chname); return; } + if (p_or_n != NOTICE && chptr->mode.mode & MODE_NOACTION) + !strncasecmp(text + 1, "ACTION", 6)) + { + sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN, + form_str(ERR_CANNOTSENDTOCHAN), chptr->chname); + return; + } if (p_or_n != NOTICE && *text == '\001' && strncasecmp(text + 1, "ACTION", 6)) { diff --git a/src/chmode.c b/src/chmode.c index b518733..7095ade 100644 --- a/src/chmode.c +++ b/src/chmode.c @@ -1400,7 +1400,7 @@ struct ChannelMode chmode_table[256] = {chm_nosuch, 0 }, /* A */ {chm_nosuch, 0 }, /* B */ {chm_simple, MODE_NOCTCP }, /* C */ - {chm_nosuch, 0 }, /* D */ + {chm_simple, MODE_NOACTION }, /* D */ {chm_nosuch, 0 }, /* E */ {chm_simple, MODE_FREETARGET }, /* F */ {chm_nosuch, 0 }, /* G */