1 |
/** |
2 |
* ircd_nohalfops.C: Module to disable halfop (+h) mode. |
3 |
* |
4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
5 |
* Rights to this code are as documented in COPYING. |
6 |
* |
7 |
* Module to disable halfop (+h) mode. |
8 |
* This will stop Atheme setting this mode by itself, but it can still |
9 |
* be used via OperServ MODE etc. |
10 |
* |
11 |
* Note: this module does not work with the halfops autodetection |
12 |
* in the charybdis protocol module. |
13 |
* |
14 |
* |
15 |
* Portions of this file were derived from sources bearing the following license: |
16 |
* Copyright © 2006 Jilles Tjoelker |
17 |
* Rights to this code are as documented in doc/pod/license.pod. |
18 |
* |
19 |
* $Id: ircd_nohalfops.C,v 1.4 2007-09-16 18:54:43 pippijn Exp $ |
20 |
*/ |
21 |
|
22 |
#include "atheme.h" |
23 |
#include <ermyth/module.h> |
24 |
|
25 |
static char const rcsid[] = "$Id: ircd_nohalfops.C,v 1.4 2007-09-16 18:54:43 pippijn Exp $"; |
26 |
|
27 |
REGISTER_MODULE ("ircd_nohalfops", false, "The Ermyth Team <http://ermyth.xinutec.org>"); |
28 |
|
29 |
static bool oldflag; |
30 |
|
31 |
bool |
32 |
_modinit (module *m) |
33 |
{ |
34 |
if (ircd == NULL) |
35 |
{ |
36 |
slog (LG_ERROR, "Module %s must be loaded after a protocol module.", m->name); |
37 |
return false; |
38 |
} |
39 |
oldflag = ircd->uses_halfops; |
40 |
ircd->uses_halfops = false; |
41 |
update_chanacs_flags (); |
42 |
|
43 |
return true; |
44 |
} |
45 |
|
46 |
void |
47 |
_moddeinit () |
48 |
{ |
49 |
ircd->uses_halfops = oldflag; |
50 |
update_chanacs_flags (); |
51 |
} |