]> jfr.im git - solanum.git/blobdiff - extensions/createoperonly.c
explicitly show IP in SNO_BANNED snotes
[solanum.git] / extensions / createoperonly.c
index ec92540a66739f31a9bf1dc6ee4cf17fb3c13329..50d996def91510398d8eccdc5aa2afd4cd66d97b 100644 (file)
 #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, 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;