13 static void h_can_join(hook_data_channel
*);
14 static const char chm_insecure_desc
[] =
15 "Adds channel mode +U that allows non-SSL users to join a channel, "
16 "disallowing them by default";
18 mapi_hfn_list_av1 sslonly_hfnlist
[] = {
19 { "can_join", (hookfn
) h_can_join
},
23 static unsigned int mymode
;
28 mymode
= cflag_add('U', chm_simple
);
42 DECLARE_MODULE_AV2(chm_insecure
, _modinit
, _moddeinit
, NULL
, NULL
, sslonly_hfnlist
, NULL
, NULL
, chm_insecure_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
) && !IsSSLClient(source_p
)) {
51 /* XXX This is equal to ERR_THROTTLE */
52 sendto_one_numeric(source_p
, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr
->chname
);
53 data
->approved
= ERR_CUSTOM
;