]>
Commit | Line | Data |
---|---|---|
1 | /* | |
2 | * Deny user to remove +i flag except they are irc operators | |
3 | * | |
4 | * Based off no_oper_invis.c by jilles | |
5 | * | |
6 | * Note that +i must be included in default_umodes | |
7 | */ | |
8 | ||
9 | #include "stdinc.h" | |
10 | #include "modules.h" | |
11 | #include "client.h" | |
12 | #include "hook.h" | |
13 | #include "ircd.h" | |
14 | #include "send.h" | |
15 | #include "s_conf.h" | |
16 | #include "s_newconf.h" | |
17 | ||
18 | static const char noi_desc[] = | |
19 | "Do not allow users to remove user mode +i unless they are operators"; | |
20 | ||
21 | static void h_noi_umode_changed(void *); | |
22 | ||
23 | mapi_hfn_list_av1 noi_hfnlist[] = { | |
24 | { "umode_changed", h_noi_umode_changed }, | |
25 | { NULL, NULL } | |
26 | }; | |
27 | ||
28 | DECLARE_MODULE_AV2(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL, NULL, noi_desc); | |
29 | ||
30 | static void | |
31 | h_noi_umode_changed(void *data) | |
32 | { | |
33 | hook_data_umode_changed *hdata = data; | |
34 | struct Client *source_p = hdata->client; | |
35 | ||
36 | if (MyClient(source_p) && !IsOperGeneral(source_p) && !IsInvisible(source_p)) { | |
37 | SetInvisible(source_p); | |
38 | } | |
39 | } |