]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/no_oper_invis.c
Add SHA256/SHA512 support to crypt.c and fix up the MD5 component (it seemed to have...
[irc/rqf/shadowircd.git] / extensions / no_oper_invis.c
CommitLineData
212380e3 1/*
2 * Deny opers setting themselves +i unless they are bots (i.e. have
3 * hidden_oper privilege).
4 * -- jilles
5 *
212380e3 6 */
7
8#include "stdinc.h"
9#include "modules.h"
10#include "client.h"
11#include "hook.h"
12#include "ircd.h"
13#include "send.h"
14#include "s_conf.h"
15#include "s_newconf.h"
16
17static void h_noi_umode_changed(hook_data_umode_changed *);
18
19mapi_hfn_list_av1 noi_hfnlist[] = {
20 { "umode_changed", (hookfn) h_noi_umode_changed },
21 { NULL, NULL }
22};
23
652b8478 24DECLARE_MODULE_AV1(no_oper_invis, NULL, NULL, NULL, NULL, noi_hfnlist, "$Revision: 3219 $");
212380e3 25
26static void
27h_noi_umode_changed(hook_data_umode_changed *hdata)
28{
29 struct Client *source_p = hdata->client;
30
31 if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) &&
32 IsInvisible(source_p))
33 {
34 ClearInvisible(source_p);
35 /* If they tried /umode +i, complain; do not complain
36 * if they opered up while invisible -- jilles */
37 if (hdata->oldumodes & UMODE_OPER)
38 sendto_one_notice(source_p, ":*** Opers may not set themselves invisible");
39 }
40}