- if(MyClient(target_p))
- {
- /* XXX Controversial? allow opers always to send through a +g */
- if(!IsServer(source_p) && (IsSetCallerId(target_p) ||
- (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])))
- {
- /* 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, command, target_p->name, text);
- }
- else if (IsSetRegOnlyMsg(target_p) && !source_p->user->suser[0])
- {
- if (p_or_n != NOTICE)
- sendto_one_numeric(source_p, ERR_NONONREG,
- form_str(ERR_NONONREG),
- target_p->name);
- }
- else
- {
- /* check for accept, flag recipient incoming message */
- if(p_or_n != NOTICE)
- {
- sendto_one_numeric(source_p, ERR_TARGUMODEG,
- form_str(ERR_TARGUMODEG),
- target_p->name);
- }
+ hdata.msgtype = msgtype;
+ hdata.source_p = source_p;
+ hdata.target_p = target_p;
+ hdata.text = text;
+ hdata.approved = 0;