13 static const char chm_insecure_desc
[] =
14 "Adds channel mode +U that allows non-SSL users to join a channel, "
15 "disallowing them by default";
17 static void h_can_join(hook_data_channel
*);
19 mapi_hfn_list_av1 sslonly_hfnlist
[] = {
20 { "can_join", (hookfn
) h_can_join
},
24 static unsigned int mymode
;
29 mymode
= cflag_add('U', chm_simple
);
43 DECLARE_MODULE_AV2(chm_insecure
, _modinit
, _moddeinit
, NULL
, NULL
, sslonly_hfnlist
, NULL
, NULL
, chm_insecure_desc
);
46 h_can_join(hook_data_channel
*data
)
48 struct Client
*source_p
= data
->client
;
49 struct Channel
*chptr
= data
->chptr
;
51 if(!(chptr
->mode
.mode
& mymode
) && !IsSSLClient(source_p
)) {
52 /* XXX This is equal to ERR_THROTTLE */
53 sendto_one_numeric(source_p
, 480, "%s :Cannot join channel (-U) - SSL/TLS required", chptr
->chname
);
54 data
->approved
= ERR_CUSTOM
;