X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/04f832b7783aa1973717135a04aaa89d62b12e25..78825899cd6b68037fd1b3c6c77afb7d10c4774e:/extensions/createoperonly.c diff --git a/extensions/createoperonly.c b/extensions/createoperonly.c index 1fdb41d3..50d996de 100644 --- a/extensions/createoperonly.c +++ b/extensions/createoperonly.c @@ -15,22 +15,26 @@ #include "s_conf.h" #include "snomask.h" #include "numeric.h" +#include "s_newconf.h" -static void h_can_create_channel_authenticated(hook_data_client_approval *); +static const char restrict_desc[] = "Restricts channel creation to IRC operators"; + +static void h_can_create_channel_authenticated(void *); mapi_hfn_list_av1 restrict_hfnlist[] = { - { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, + { "can_create_channel", h_can_create_channel_authenticated }, { NULL, NULL } }; -DECLARE_MODULE_AV2(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, NULL); +DECLARE_MODULE_AV2(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, restrict_desc); static void -h_can_create_channel_authenticated(hook_data_client_approval *data) +h_can_create_channel_authenticated(void *data_) { + hook_data_client_approval *data = data_; struct Client *source_p = data->client; - if (!IsOper(source_p)) + if (!IsOperGeneral(source_p)) { sendto_one_notice(source_p, ":*** Channel creation is restricted to network staff only."); data->approved = ERR_NEEDREGGEDNICK;