Revert "invite: rework the way can_invite hook is called"
This reverts commit ed06fed70a67b0cdd4e53aad575fca7b9d046061.
This commit is contained in:
parent
ddb063e2f9
commit
e3c27d7dbd
1 changed files with 14 additions and 13 deletions
|
@ -145,27 +145,28 @@ m_invite(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
|
|||
return;
|
||||
}
|
||||
|
||||
hdata.chptr = chptr;
|
||||
hdata.msptr = msptr;
|
||||
hdata.client = source_p;
|
||||
hdata.target = target_p;
|
||||
hdata.approved = !(is_chanop(msptr) || (chptr->mode.mode & MODE_FREEINVITE));
|
||||
|
||||
call_hook(can_invite_hook, &hdata);
|
||||
if (hdata.approved)
|
||||
if (MyClient(source_p))
|
||||
{
|
||||
if (MyClient(target_p))
|
||||
hdata.chptr = chptr;
|
||||
hdata.msptr = msptr;
|
||||
hdata.client = source_p;
|
||||
hdata.target = target_p;
|
||||
hdata.approved = !(is_chanop(msptr) || (chptr->mode.mode & MODE_FREEINVITE));
|
||||
|
||||
call_hook(can_invite_hook, &hdata);
|
||||
if (hdata.approved)
|
||||
{
|
||||
if (hdata.error)
|
||||
sendto_one_numeric(source_p, hdata.approved, "%s", hdata.error);
|
||||
else if (hdata.approved == ERR_CHANOPRIVSNEEDED)
|
||||
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
|
||||
me.name, source_p->name, parv[2]);
|
||||
me.name, source_p->name, parv[2]);
|
||||
|
||||
add_reply_target(target_p, source_p);
|
||||
if (MyClient(target_p))
|
||||
add_reply_target(target_p, source_p);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* store invites when they could affect the ability to join
|
||||
|
|
Loading…
Reference in a new issue