message: remove hardcoded +R logic

This commit is contained in:
Ariadne Conill 2020-06-26 11:55:07 -06:00
parent 0b8910e40b
commit ed3b56f965

View file

@ -725,8 +725,7 @@ msg_client(enum message_type msgtype,
* as a way of griefing. --nenolod * as a way of griefing. --nenolod
*/ */
if(msgtype != MESSAGE_TYPE_NOTICE && if(msgtype != MESSAGE_TYPE_NOTICE &&
(IsSetCallerId(source_p) || IsSetCallerId(source_p) &&
(IsSetRegOnlyMsg(source_p) && !target_p->user->suser[0])) &&
!accept_message(target_p, source_p) && !accept_message(target_p, source_p) &&
!IsOper(target_p)) !IsOper(target_p))
{ {
@ -818,8 +817,7 @@ msg_client(enum message_type msgtype,
} }
/* XXX Controversial? allow opers always to send through a +g */ /* XXX Controversial? allow opers always to send through a +g */
if(!IsServer(source_p) && (IsSetCallerId(target_p) || if(!IsServer(source_p) && IsSetCallerId(target_p))
(IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])))
{ {
/* Here is the anti-flood bot/spambot code -db */ /* Here is the anti-flood bot/spambot code -db */
if(accept_message(source_p, target_p) || IsOper(source_p)) if(accept_message(source_p, target_p) || IsOper(source_p))
@ -830,13 +828,6 @@ msg_client(enum message_type msgtype,
source_p->username, source_p->username,
source_p->host, cmdname[msgtype], target_p->name, text); source_p->host, cmdname[msgtype], target_p->name, text);
} }
else if (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])
{
if (msgtype != MESSAGE_TYPE_NOTICE)
sendto_one_numeric(source_p, ERR_NONONREG,
form_str(ERR_NONONREG),
target_p->name);
}
else else
{ {
/* check for accept, flag recipient incoming message */ /* check for accept, flag recipient incoming message */