mirror of
https://github.com/matrix-construct/construct
synced 2025-02-18 17:50:16 +01:00
* To benefit from the precompiled-header (PCH) it MUST provide "the first C token." Advantages: Never worry about the include stack again. Remember, this means one less thing for random module developers, community people learning C++, and new developers to deal with. It should reduce the learning curve and barrier for participation. Disadvantages: Makes overall compilation a bit slower, especially without any additional work to improve it again. There are several opportunities, places where the PCH is probably being ignored, etc that can be addressed.
30 lines
752 B
C++
30 lines
752 B
C++
/*
|
|
* restrict unauthenticated users from doing anything as channel op
|
|
*/
|
|
|
|
using namespace ircd;
|
|
|
|
static const char restrict_desc[] =
|
|
"Restrict unautenticated users from doing anything as channel ops";
|
|
|
|
static void hack_channel_access(void *data);
|
|
|
|
mapi_hfn_list_av1 restrict_unauthenticated_hfnlist[] = {
|
|
{ "get_channel_access", (hookfn) hack_channel_access },
|
|
{ NULL, NULL }
|
|
};
|
|
|
|
static void
|
|
hack_channel_access(void *vdata)
|
|
{
|
|
hook_data_channel_approval *data = (hook_data_channel_approval *) vdata;
|
|
|
|
if (!MyClient(data->client))
|
|
return;
|
|
|
|
if (EmptyString(data->client->user->suser))
|
|
data->approved = 0;
|
|
}
|
|
|
|
DECLARE_MODULE_AV2(restrict_unauthenticated, NULL, NULL, NULL, NULL,
|
|
restrict_unauthenticated_hfnlist, NULL, NULL, restrict_desc);
|