]> jfr.im git - solanum.git/blame - extensions/force_user_invis.c
Merge pull request #302 from edk0/sasl-usercloak
[solanum.git] / extensions / force_user_invis.c
CommitLineData
30ae6c6f
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 *
f9de2f89 6 * Note that +i must be included in default_umodes
30ae6c6f
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
a278a4fc
EM
18static const char noi_desc[] =
19 "Do not allow users to remove user mode +i unless they are operators";
20
30ae6c6f
JT
21static void h_noi_umode_changed(hook_data_umode_changed *);
22
23mapi_hfn_list_av1 noi_hfnlist[] = {
24 { "umode_changed", (hookfn) h_noi_umode_changed },
25 { NULL, NULL }
26};
27
a278a4fc 28DECLARE_MODULE_AV2(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL, NULL, noi_desc);
30ae6c6f
JT
29
30static void
31h_noi_umode_changed(hook_data_umode_changed *hdata)
32{
33 struct Client *source_p = hdata->client;
34
35 if (MyClient(source_p) && !IsOper(source_p) && !IsInvisible(source_p)) {
36 SetInvisible(source_p);
37 }
38}