]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/force_user_invis.c
BOPM/TCM do not need the ability to global kill, so remove it from server_bot
[irc/rqf/shadowircd.git] / extensions / force_user_invis.c
CommitLineData
013726d7
JT
1/*
2 * Deny user to remove +i flag except they are irc operators
3 *
4 * Based off no_oper_invis.c by jilles
5 *
bf4c2e5b 6 * Note that +i must be included in default_umodes
013726d7
JT
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
18static void h_noi_umode_changed(hook_data_umode_changed *);
19
20mapi_hfn_list_av1 noi_hfnlist[] = {
21 { "umode_changed", (hookfn) h_noi_umode_changed },
22 { NULL, NULL }
23};
24
25DECLARE_MODULE_AV1(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, "1.0.0");
26
27static void
28h_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}