13 static void h_can_join(hook_data_channel
*);
15 mapi_hfn_list_av1 sslonly_hfnlist
[] = {
16 { "can_join", (hookfn
) h_can_join
},
20 static unsigned int mymode
;
22 static const char chm_sslonly_desc
[] =
23 "Adds channel mode +S that bans non-SSL users from joing a channel";
28 mymode
= cflag_add('S', chm_simple
);
41 DECLARE_MODULE_AV2(chm_sslonly
, _modinit
, _moddeinit
, NULL
, NULL
, sslonly_hfnlist
, NULL
, NULL
, chm_sslonly_desc
);
44 h_can_join(hook_data_channel
*data
)
46 struct Client
*source_p
= data
->client
;
47 struct Channel
*chptr
= data
->chptr
;
49 if((chptr
->mode
.mode
& mymode
) && !IsSSLClient(source_p
)) {
50 /* XXX This is equal to ERR_THROTTLE */
51 sendto_one_numeric(source_p
, 480, "%s :Cannot join channel (+S) - SSL/TLS required", chptr
->chname
);
52 data
->approved
= ERR_CUSTOM
;