Revert "invite: rework the way can_invite hook is called"

This reverts commit ed06fed70a67b0cdd4e53aad575fca7b9d046061.
This commit is contained in:
Ariadne Conill 2020-06-26 14:20:52 -06:00
parent ddb063e2f9
commit e3c27d7dbd

View file

@ -145,6 +145,8 @@ m_invite(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
return;
}
if (MyClient(source_p))
{
hdata.chptr = chptr;
hdata.msptr = msptr;
hdata.client = source_p;
@ -153,8 +155,6 @@ m_invite(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
call_hook(can_invite_hook, &hdata);
if (hdata.approved)
{
if (MyClient(target_p))
{
if (hdata.error)
sendto_one_numeric(source_p, hdata.approved, "%s", hdata.error);
@ -162,11 +162,12 @@ m_invite(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
me.name, source_p->name, parv[2]);
if (MyClient(target_p))
add_reply_target(target_p, source_p);
}
return;
}
}
/* store invites when they could affect the ability to join
* for +l/+j just check if the mode is set, this varies over time