]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - extensions/chm_adminonly.c
Change the DNSBL hit snomask to SNO_REJ (+r) as to not spam SNO_GENERAL
[irc/rqf/shadowircd.git] / extensions / chm_adminonly.c
index f018de20724a916611ffc0446dcd0487d4650107..c478e91e531438cc37336daa9784e6bff07f7c1d 100644 (file)
@@ -17,13 +17,14 @@ mapi_hfn_list_av1 adminonly_hfnlist[] = {
        { NULL, NULL }
 };
 
+static unsigned int mymode;
+
 static int
 _modinit(void)
 {
-       chmode_table['A'].mode_type = find_cflag_slot();
-       chmode_table['A'].set_func = chm_staff;
-
-       construct_noparam_modes();
+       mymode = cflag_add('A', chm_staff);
+       if (mymode == 0)
+               return -1;
 
        return 0;
 }
@@ -31,9 +32,7 @@ _modinit(void)
 static void
 _moddeinit(void)
 {
-       chmode_table['A'].mode_type = 0;
-
-       construct_noparam_modes();
+       cflag_orphan('A');
 }
 
 DECLARE_MODULE_AV1(chm_adminonly, _modinit, _moddeinit, NULL, NULL, adminonly_hfnlist, "$Revision$");
@@ -44,7 +43,7 @@ h_can_join(hook_data_channel *data)
        struct Client *source_p = data->client;
        struct Channel *chptr = data->chptr;
 
-       if((chptr->mode.mode & chmode_flags['A']) && !IsOperAdmin(source_p)) {
+       if((chptr->mode.mode & mymode) && !IsAdmin(source_p)) {
                sendto_one_numeric(source_p, 519, "%s :Cannot join channel (+A) - you are not an IRC server administrator", chptr->chname);
                data->approved = ERR_CUSTOM;
        }