X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/878733fd68ee18e371462e7952ad21e7fd84c96b..d1c7eccf6af5e957c316a671cfdf5a00ab5043b3:/modules/core/m_message.c diff --git a/modules/core/m_message.c b/modules/core/m_message.c index faca813..1ac0cfb 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -361,7 +361,7 @@ build_target_list(int p_or_n, const char *command, struct Client *client_p, msptr = find_channel_membership(chptr, source_p); - if(!IsServer(source_p) && !IsService(source_p) && !is_chanop_voiced(msptr)) + if(!IsServer(source_p) && !IsService(source_p) && !is_chanop_voiced(msptr) && !IsOverride(source_p)) { sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED), get_id(&me, source_p), @@ -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,6 +516,34 @@ 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 && + !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)) { @@ -728,8 +759,15 @@ msg_client(int p_or_n, const char *command, if(MyClient(target_p)) { + if (IsSetNoCTCP(target_p) && p_or_n != NOTICE && *text == '\001' && strncasecmp(text + 1, "ACTION", 6)) + { + sendto_one_numeric(source_p, ERR_NOCTCP, + form_str(ERR_NOCTCP), + target_p->name); + } /* XXX Controversial? allow opers always to send through a +g */ - if(!IsServer(source_p) && (IsSetCallerId(target_p) || + else if(!IsServer(source_p) && (IsSetCallerId(target_p) || + (IsSetSCallerId(target_p) && !has_common_channel(source_p, target_p)) || (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0]))) { /* Here is the anti-flood bot/spambot code -db */ @@ -748,6 +786,13 @@ msg_client(int p_or_n, const char *command, form_str(ERR_NONONREG), target_p->name); } + else if (IsSetSCallerId(target_p) && !has_common_channel(source_p, target_p)) + { + if (p_or_n != NOTICE) + sendto_one_numeric(source_p, ERR_NOCOMMONCHAN, + form_str(ERR_NOCOMMONCHAN), + target_p->name); + } else { /* check for accept, flag recipient incoming message */