]> jfr.im git - irc/rqf/shadowircd.git/blob - extensions/force_user_invis.c
Move cmode +N to cmode +d, so that extensions/m_roleplay can retain cmode +N and...
[irc/rqf/shadowircd.git] / extensions / force_user_invis.c
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 void h_noi_umode_changed(hook_data_umode_changed *);
19
20 mapi_hfn_list_av1 noi_hfnlist[] = {
21 { "umode_changed", (hookfn) h_noi_umode_changed },
22 { NULL, NULL }
23 };
24
25 DECLARE_MODULE_AV1(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, "1.0.0");
26
27 static void
28 h_noi_umode_changed(hook_data_umode_changed *hdata)
29 {
30 struct Client *source_p = hdata->client;
31
32 if (MyClient(source_p) && !IsOper(source_p) && !IsInvisible(source_p)) {
33 SetInvisible(source_p);
34 }
35 }