2 * Deny opers setting themselves +i unless they are bots (i.e. have
3 * hidden_oper privilege).
14 #include "s_newconf.h"
16 static const char noi_desc
[] =
17 "Disallow operators from setting user mode +i on themselves";
19 static void h_noi_umode_changed(hook_data_umode_changed
*);
21 mapi_hfn_list_av1 noi_hfnlist
[] = {
22 { "umode_changed", (hookfn
) h_noi_umode_changed
},
26 DECLARE_MODULE_AV2(no_oper_invis
, NULL
, NULL
, NULL
, NULL
, noi_hfnlist
, NULL
, NULL
, noi_desc
);
29 h_noi_umode_changed(hook_data_umode_changed
*hdata
)
31 struct Client
*source_p
= hdata
->client
;
33 if (MyClient(source_p
) && IsOper(source_p
) && !IsOperInvis(source_p
) &&
34 IsInvisible(source_p
))
36 ClearInvisible(source_p
);
37 /* If they tried /umode +i, complain; do not complain
38 * if they opered up while invisible -- jilles */
39 if (hdata
->oldumodes
& UMODE_OPER
)
40 sendto_one_notice(source_p
, ":*** Opers may not set themselves invisible");