13 /* gcc -fPIC -DPIC -shared -I. -I../include -I../libratbox/include -O0 -Wall -std=gnu99 -g -DIRCD_PREFIX=\"/home/dwr/build/charybdis\" chm_operonly.c -o chm_operonly.so */
15 static void h_can_join(hook_data_channel
*);
17 mapi_hfn_list_av1 operonly_hfnlist
[] = {
18 { "can_join", (hookfn
) h_can_join
},
24 /* This is a simple example of how to use dynamic channel modes.
25 * Not tested enough yet, use at own risk.
31 /* add the channel mode to the available slot */
32 chmode_table
['O'].mode_type
= find_cflag_slot();
33 chmode_table
['O'].set_func
= chm_simple
;
35 construct_noparam_modes();
41 /* Well, the first ugly thing is that we changle chmode_table in _modinit
42 * and chmode_flags in _moddeinit (different arrays) - must be fixed.
48 /* disable the channel mode and remove it from the available list */
49 chmode_table
['O'].mode_type
= 0;
51 construct_noparam_modes();
54 DECLARE_MODULE_AV1(chm_operonly
, _modinit
, _moddeinit
, NULL
, NULL
, operonly_hfnlist
, "$Revision$");
57 h_can_join(hook_data_channel
*data
)
59 struct Client
*source_p
= data
->client
;
60 struct Channel
*chptr
= data
->chptr
;
62 if((chptr
->mode
.mode
& chmode_flags
['O']) && !IsOper(source_p
)) {
63 sendto_one_notice(source_p
, ":Only IRC Operators could join this channel!");
64 data
->approved
= ERR_CUSTOM
;