13 static const char chm_operonly_desc
[] =
14 "Adds channel mode +O which makes a channel operator-only";
16 static void h_can_join(hook_data_channel
*);
18 mapi_hfn_list_av1 operonly_hfnlist
[] = {
19 { "can_join", (hookfn
) h_can_join
},
23 static unsigned int mymode
;
28 mymode
= cflag_add('O', chm_staff
);
42 DECLARE_MODULE_AV2(chm_operonly
, _modinit
, _moddeinit
, NULL
, NULL
, operonly_hfnlist
, NULL
, NULL
, chm_operonly_desc
);
45 h_can_join(hook_data_channel
*data
)
47 struct Client
*source_p
= data
->client
;
48 struct Channel
*chptr
= data
->chptr
;
50 if((chptr
->mode
.mode
& mymode
) && !IsOper(source_p
)) {
51 sendto_one_numeric(source_p
, 520, "%s :Cannot join channel (+O) - you are not an IRC operator", chptr
->chname
);
52 data
->approved
= ERR_CUSTOM
;