13 static const char chm_adminonly_desc
[] =
14 "Enables channel mode +A that blocks non-admins from joining a channel";
16 static void h_can_join(void *);
18 mapi_hfn_list_av1 adminonly_hfnlist
[] = {
19 { "can_join", h_can_join
},
23 static unsigned int mymode
;
28 mymode
= cflag_add('A', chm_staff
);
41 DECLARE_MODULE_AV2(chm_adminonly
, _modinit
, _moddeinit
, NULL
, NULL
, adminonly_hfnlist
, NULL
, NULL
, chm_adminonly_desc
);
44 h_can_join(void *data_
)
46 hook_data_channel
*data
= data_
;
47 struct Client
*source_p
= data
->client
;
48 struct Channel
*chptr
= data
->chptr
;
50 if((chptr
->mode
.mode
& mymode
) && !IsAdmin(source_p
)) {
51 sendto_one_numeric(source_p
, 519, "%s :Cannot join channel (+A) - you are not an IRC server administrator", chptr
->chname
);
52 data
->approved
= ERR_CUSTOM
;