X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/dacfb79db65997e8c3c0c668d60ab21d3a8bdfb7..4355dbd3c9e2325c97dd464c78360edf4a957ade:/modules/core/m_message.c diff --git a/modules/core/m_message.c b/modules/core/m_message.c index b4d8d40..a3378f1 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -484,6 +484,9 @@ msg_channel(int p_or_n, const char *command, { int result; char text2[BUFSIZE]; + int contor; + int caps = 0; + int len = 0; if(MyClient(source_p)) { @@ -513,13 +516,28 @@ msg_channel(int p_or_n, const char *command, 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, form_str(ERR_CANNOTSENDTOCHAN), chptr->chname); return; } - if (p_or_n != NOTICE && chptr->mode.mode & MODE_NOACTION) + if (p_or_n != NOTICE && chptr->mode.mode & MODE_NOACTION && !strncasecmp(text + 1, "ACTION", 6)) { sendto_one_numeric(source_p, ERR_CANNOTSENDTOCHAN,