channel.
+N - No nickchanges. People on the channel will not be able to
change nick.
+ +N - Block messages in all caps. Messages that are more than
+ 50% capital letters will be blocked.
WITH PARAMETERS:
+f - Forward. Forwards users who cannot join because of +i,
#define MODE_NOACTION 0x32000 /* Block CTCP ACTION directed to this channel */
#define MODE_NOKICK 0x64000 /* Disable /kick on this channel */
#define MODE_NONICK 0x128000 /* Disable /nick for anyone on this channel */
+#define MODE_NOCAPS 0x256000 /* Block messages in all capital letters */
#define CHFL_BAN 0x10000000 /* ban channel flag */
#define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */
{
int result;
char text2[BUFSIZE];
+ int contor;
+ int caps = 0;
+ int len = 0;
if(MyClient(source_p))
{
if(result == CAN_SEND_OPV ||
!flood_attack_channel(p_or_n, source_p, chptr, chptr->chname))
{
+ if (strlen(text) > 10 && chptr->mode.mode & MODE_NOCAPS)
+ {
+ for(contor=0; contor < strlen(text); contor++)
+ {
+ if(IsUpper(text[contor]) && !isdigit(text[contor]))
+ caps++;
+ len++;
+ }
+ if(((caps*100)/(len)) >= 50)
+ {
+ sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,
+ form_str(ERR_CANNOTSENDTOCHAN), chptr->chname);
+ return;
+ }
+ }
if (p_or_n != PRIVMSG && chptr->mode.mode & MODE_NONOTICE)
{
sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,
{chm_simple, MODE_NOACTION }, /* D */
{chm_simple, MODE_NOKICK }, /* E */
{chm_simple, MODE_FREETARGET }, /* F */
- {chm_nosuch, 0 }, /* G */
+ {chm_simple, MODE_NOCAPS }, /* G */
{chm_nosuch, 0 }, /* H */
{chm_ban, CHFL_INVEX }, /* I */
{chm_nosuch, 0 }, /* J */