13 static void h_can_join(hook_data_channel
*);
15 mapi_hfn_list_av1 operonly_hfnlist
[] = {
16 { "can_join", (hookfn
) h_can_join
},
22 /* This is a simple example of how to use dynamic channel modes.
23 * Not tested enough yet, use at own risk.
29 /* add the channel mode to the available slot */
30 chmode_table
['O'].mode_type
= find_cflag_slot();
31 chmode_table
['O'].set_func
= chm_staff
;
33 construct_noparam_modes();
39 /* Well, the first ugly thing is that we changle chmode_table in _modinit
40 * and chmode_flags in _moddeinit (different arrays) - must be fixed.
46 /* disable the channel mode and remove it from the available list */
47 chmode_table
['O'].mode_type
= 0;
49 construct_noparam_modes();
52 DECLARE_MODULE_AV1(chm_operonly
, _modinit
, _moddeinit
, NULL
, NULL
, operonly_hfnlist
, "$Revision$");
55 h_can_join(hook_data_channel
*data
)
57 struct Client
*source_p
= data
->client
;
58 struct Channel
*chptr
= data
->chptr
;
60 if((chptr
->mode
.mode
& chmode_flags
['O']) && !IsOper(source_p
)) {
61 sendto_one_numeric(source_p
, 520, "%s :Cannot join channel (+O) - you are not an IRC operator", chptr
->chname
);
62 data
->approved
= ERR_CUSTOM
;