From 4a9cf8698155cbcc9b758c0191d031fd952adc17 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 26 Jun 2020 12:49:52 -0600 Subject: [PATCH] message: remove hardcoded +G logic --- modules/core/m_message.c | 72 ++-------------------------------------- 1 file changed, 2 insertions(+), 70 deletions(-) diff --git a/modules/core/m_message.c b/modules/core/m_message.c index e329e7bf..227745d6 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -718,32 +718,6 @@ msg_client(enum message_type msgtype, if(MyClient(source_p)) { - /* - * XXX: Controversial? Allow target users to send replies - * through a +g. Rationale is that people can presently use +g - * as a way to taunt users, e.g. harass them and hide behind +g - * as a way of griefing. --nenolod - */ - if(msgtype != MESSAGE_TYPE_NOTICE && - IsSetCallerId(source_p) && - !accept_message(target_p, source_p) && - !IsOper(target_p)) - { - if(rb_dlink_list_length(&source_p->localClient->allow_list) < - (unsigned long)ConfigFileEntry.max_accept) - { - rb_dlinkAddAlloc(target_p, &source_p->localClient->allow_list); - rb_dlinkAddAlloc(source_p, &target_p->on_allow_list); - } - else - { - sendto_one_numeric(source_p, ERR_OWNMODE, - form_str(ERR_OWNMODE), - target_p->name, "+g"); - return; - } - } - /* reset idle time for message only if its not to self * and its not a notice */ if(msgtype != MESSAGE_TYPE_NOTICE) @@ -816,50 +790,8 @@ msg_client(enum message_type msgtype, return; } - /* XXX Controversial? allow opers always to send through a +g */ - if(!IsServer(source_p) && IsSetCallerId(target_p)) - { - /* Here is the anti-flood bot/spambot code -db */ - if(accept_message(source_p, target_p) || IsOper(source_p)) - { - add_reply_target(target_p, source_p); - sendto_one(target_p, ":%s!%s@%s %s %s :%s", - source_p->name, - source_p->username, - source_p->host, cmdname[msgtype], target_p->name, text); - } - else - { - /* check for accept, flag recipient incoming message */ - if(msgtype != MESSAGE_TYPE_NOTICE) - { - sendto_one_numeric(source_p, ERR_TARGUMODEG, - form_str(ERR_TARGUMODEG), - target_p->name); - } - - if((target_p->localClient->last_caller_id_time + - ConfigFileEntry.caller_id_wait) < rb_current_time()) - { - if(msgtype != MESSAGE_TYPE_NOTICE) - sendto_one_numeric(source_p, RPL_TARGNOTIFY, - form_str(RPL_TARGNOTIFY), - target_p->name); - - add_reply_target(target_p, source_p); - sendto_one(target_p, form_str(RPL_UMODEGMSG), - me.name, target_p->name, source_p->name, - source_p->username, source_p->host); - - target_p->localClient->last_caller_id_time = rb_current_time(); - } - } - } - else - { - add_reply_target(target_p, source_p); - sendto_anywhere(target_p, source_p, cmdname[msgtype], ":%s", text); - } + add_reply_target(target_p, source_p); + sendto_anywhere(target_p, source_p, cmdname[msgtype], ":%s", text); } else sendto_anywhere(target_p, source_p, cmdname[msgtype], ":%s", text);