Debian Codegraph @

modules/protocol/mixin_nohalfops.c

raw
1 /*
2 * Copyright (c) 2006 Jilles Tjoelker
3 * Rights to this code are as documented in doc/LICENSE.
4 *
5 * Module to disable halfop (+h) mode.
6 * This will stop Atheme setting this mode by itself, but it can still
7 * be used via OperServ MODE etc.
8 *
9 * Note: this module does not work with the halfops autodetection
10 * in the charybdis protocol module.
11 *
12 */
13
14 #include "atheme.h"
15
16 DECLARE_MODULE_V1
17 (
18 "protocol/mixin_nohalfops", true, _modinit, _moddeinit,
19 PACKAGE_STRING,
20 VENDOR_STRING
21 );
22
23 bool oldflag;
24
25 void _modinit(module_t *m)
26 {
27
28 if (ircd == NULL)
29 {
30 slog(LG_ERROR, "Module %s must be loaded after a protocol module.", m->name);
31 m->mflags = MODTYPE_FAIL;
32 return;
33 }
34 if (cnt.mychan > 0)
35 {
36 slog(LG_ERROR, "Module %s must be loaded from the configuration file, not via MODLOAD.", m->name);
37 m->mflags = MODTYPE_FAIL;
38 return;
39 }
40 oldflag = ircd->uses_halfops;
41 ircd->uses_halfops = false;
42 update_chanacs_flags();
43 }
44
45 void _moddeinit(module_unload_intent_t intent)
46 {
47
48 ircd->uses_halfops = oldflag;
49 update_chanacs_flags();
50 }
51
52 /* vim:cinoptions=>s,e0,n0,f0,{0,}0,^0,=s,ps,t0,c3,+s,(2s,us,)20,*30,gs,hs
53 * vim:ts=8
54 * vim:sw=8
55 * vim:noexpandtab
56 */