mirror of
https://github.com/matrix-construct/construct
synced 2024-11-19 16:30:52 +01:00
override: Hack can_send().
This commit is contained in:
parent
0343b3c563
commit
9101dbcda2
1 changed files with 22 additions and 0 deletions
|
@ -25,11 +25,13 @@
|
|||
static void check_umode_change(void *data);
|
||||
static void hack_channel_access(void *data);
|
||||
static void hack_can_join(void *data);
|
||||
static void hack_can_send(void *data);
|
||||
|
||||
mapi_hfn_list_av1 override_hfnlist[] = {
|
||||
{ "umode_changed", (hookfn) check_umode_change },
|
||||
{ "get_channel_access", (hookfn) hack_channel_access },
|
||||
{ "can_join", (hookfn) hack_can_join },
|
||||
{ "can_send", (hookfn) hack_can_send },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
@ -176,6 +178,26 @@ hack_can_join(void *vdata)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
hack_can_send(void *vdata)
|
||||
{
|
||||
hook_data_channel_approval *data = (hook_data_channel_approval *) vdata;
|
||||
|
||||
if (data->approved == CAN_SEND_NONOP || data->approved == CAN_SEND_OPV)
|
||||
return;
|
||||
|
||||
if (data->client->umodes & user_modes['p'])
|
||||
{
|
||||
update_session_deadline(data->client, NULL);
|
||||
data->approved = CAN_SEND_OPV;
|
||||
|
||||
#ifdef XXX_UNSURE_IF_WANT
|
||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s is using oper-override on %s (banwalking)",
|
||||
get_oper_name(data->client), data->chptr->chname);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
struct ev_entry *expire_override_deadlines_ev = NULL;
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue