- /* 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);
+ echo_msg(target_p, source_p, msgtype, text);