#include "s_serv.h"
#include "numeric.h"
#include "chmode.h"
+#include "messages.h"
#include "inline/stringops.h"
+static const char chm_nonotice_desc[] =
+ "Adds channel mode +T which blocks notices to the channel.";
+
static unsigned int mode_nonotice;
static void chm_nonotice_process(hook_data_privmsg_channel *);
if (data->approved || data->msgtype != MESSAGE_TYPE_NOTICE)
return;
- if (data->chptr.mode.mode & mode_nonotice)
+ /* block all notices except CTCPs; use chm_noctcp to block CTCPs. */
+ if (data->chptr->mode.mode & mode_nonotice && *data->text != '\001')
{
- data->approved = ERR_CUSTOM;
+ sendto_one_numeric(data->source_p, ERR_CANNOTSENDTOCHAN, form_str(ERR_CANNOTSENDTOCHAN), data->chptr->chname);
+ data->approved = ERR_CANNOTSENDTOCHAN;
return;
}
}
cflag_orphan('T');
}
-DECLARE_MODULE_AV1(chm_nonotice, _modinit, _moddeinit, NULL, NULL, chm_nonotice_hfnlist, "$Revision$");
+DECLARE_MODULE_AV2(chm_nonotice, _modinit, _moddeinit, NULL, NULL, chm_nonotice_hfnlist, NULL, NULL, chm_nonotice_desc);