]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/chm_sslonly.c
Add description for LOCOPS message.
[irc/rqf/shadowircd.git] / extensions / chm_sslonly.c
CommitLineData
0865b537
VY
1#include "stdinc.h"
2#include "modules.h"
3#include "hook.h"
4#include "client.h"
5#include "ircd.h"
6#include "send.h"
7#include "s_conf.h"
8#include "s_user.h"
9#include "s_serv.h"
10#include "numeric.h"
11#include "chmode.h"
12
13static void h_can_join(hook_data_channel *);
14
15mapi_hfn_list_av1 sslonly_hfnlist[] = {
16 { "can_join", (hookfn) h_can_join },
17 { NULL, NULL }
18};
19
20static int
21_modinit(void)
22{
23 chmode_table['S'].mode_type = find_cflag_slot();
24 chmode_table['S'].set_func = chm_simple;
25
26 construct_noparam_modes();
27
28 return 0;
29}
30
31
32static void
33_moddeinit(void)
34{
35 chmode_table['S'].mode_type = 0;
36
37 construct_noparam_modes();
38}
39
40DECLARE_MODULE_AV1(chm_sslonly, _modinit, _moddeinit, NULL, NULL, sslonly_hfnlist, "$Revision$");
41
42static void
43h_can_join(hook_data_channel *data)
44{
45 struct Client *source_p = data->client;
46 struct Channel *chptr = data->chptr;
47
48 if((chptr->mode.mode & chmode_flags['S']) && !IsSSLClient(source_p)) {
49 sendto_one_notice(source_p, ":Only users using SSL could join this channel!");
50 data->approved = ERR_CUSTOM;
51 }
52}
53