X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/d7cff1d11ba8b6a5eb393911b8edda125b2f9bbb..ed6ad7a3756992ad8c65ab11376e827f8e086013:/extensions/chm_adminonly.c diff --git a/extensions/chm_adminonly.c b/extensions/chm_adminonly.c index 9380c3d..c478e91 100644 --- a/extensions/chm_adminonly.c +++ b/extensions/chm_adminonly.c @@ -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']) && !IsAdmin(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; }