]>
Commit | Line | Data |
---|---|---|
212380e3 AC |
1 | /* |
2 | * Deny opers setting themselves +i unless they are bots (i.e. have | |
3 | * hidden_oper privilege). | |
4 | * -- jilles | |
212380e3 AC |
5 | */ |
6 | ||
7 | #include "stdinc.h" | |
8 | #include "modules.h" | |
9 | #include "client.h" | |
10 | #include "hook.h" | |
11 | #include "ircd.h" | |
12 | #include "send.h" | |
13 | #include "s_conf.h" | |
14 | #include "s_newconf.h" | |
15 | ||
16 | static void h_noi_umode_changed(hook_data_umode_changed *); | |
17 | ||
18 | mapi_hfn_list_av1 noi_hfnlist[] = { | |
19 | { "umode_changed", (hookfn) h_noi_umode_changed }, | |
20 | { NULL, NULL } | |
21 | }; | |
22 | ||
652b8478 | 23 | DECLARE_MODULE_AV1(no_oper_invis, NULL, NULL, NULL, NULL, noi_hfnlist, "$Revision: 3219 $"); |
212380e3 AC |
24 | |
25 | static void | |
26 | h_noi_umode_changed(hook_data_umode_changed *hdata) | |
27 | { | |
28 | struct Client *source_p = hdata->client; | |
29 | ||
30 | if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) && | |
31 | IsInvisible(source_p)) | |
32 | { | |
33 | ClearInvisible(source_p); | |
34 | /* If they tried /umode +i, complain; do not complain | |
35 | * if they opered up while invisible -- jilles */ | |
36 | if (hdata->oldumodes & UMODE_OPER) | |
37 | sendto_one_notice(source_p, ":*** Opers may not set themselves invisible"); | |
38 | } | |
39 | } |