shadowircd / modes / charybdis.c

#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include "chmode.h"
#include "channel.h"

struct module_modes ModuleModes;

static int
_modinit(void)
{
	ModuleModes.MODE_NOCTCP = cflag_add('C', chm_simple);
	if (ModuleModes.MODE_NOCTCP == 0)
		return -1;

	ModuleModes.MODE_REGONLY = cflag_add('r', chm_regonly);
	if (ModuleModes.MODE_REGONLY == 0)
		return -1;

	ModuleModes.MODE_NOCOLOR = cflag_add('c', chm_simple);
	if (ModuleModes.MODE_NOCOLOR == 0)
		return -1;

	ModuleModes.MODE_EXLIMIT = cflag_add('L', chm_staff);
	if (ModuleModes.MODE_EXLIMIT == 0)
		return -1;

	ModuleModes.MODE_PERMANENT = cflag_add('P', chm_staff);
	if (ModuleModes.MODE_PERMANENT == 0)
		return -1;

	ModuleModes.MODE_OPMODERATE = cflag_add('z', chm_simple);
	if (ModuleModes.MODE_OPMODERATE == 0)
		return -1;

	ModuleModes.MODE_FREEINVITE = cflag_add('g', chm_simple);
	if (ModuleModes.MODE_FREEINVITE == 0)
		return -1;

	ModuleModes.MODE_FREETARGET = cflag_add('F', chm_simple);
	if (ModuleModes.MODE_FREETARGET == 0)
		return -1;

	ModuleModes.MODE_DISFORWARD = cflag_add('Q', chm_simple);
	if (ModuleModes.MODE_DISFORWARD == 0)
		return -1;

	ModuleModes.CHFL_QUIET = cflag_add('q', chm_ban);
	if (ModuleModes.CHFL_QUIET == 0)
		return -1;

	ModuleModes.MODE_FORWARD = cflag_add('f', chm_forward);
	if (ModuleModes.MODE_FORWARD == 0)
		return -1;

	ModuleModes.MODE_THROTTLE = cflag_add('j', chm_throttle);
	if (ModuleModes.MODE_THROTTLE == 0)
		return -1;

	return 0;
}

static void
_moddeinit(void)
{
	cflag_orphan('C');
	ModuleModes.MODE_NOCTCP = 0;

	cflag_orphan('r');
	ModuleModes.MODE_REGONLY = 0;

	cflag_orphan('c');
	ModuleModes.MODE_NOCOLOR = 0;

	cflag_orphan('L');
	ModuleModes.MODE_EXLIMIT = 0;

	cflag_orphan('P');
	ModuleModes.MODE_PERMANENT = 0;

	cflag_orphan('z');
	ModuleModes.MODE_OPMODERATE = 0;

	cflag_orphan('g');
	ModuleModes.MODE_FREEINVITE = 0;

	cflag_orphan('F');
	ModuleModes.MODE_FREETARGET = 0;

	cflag_orphan('Q');
	ModuleModes.MODE_DISFORWARD = 0;

	cflag_orphan('q');
	ModuleModes.CHFL_QUIET = 0;

	cflag_orphan('f');
	ModuleModes.MODE_FORWARD = 0;

	cflag_orphan('j');
	ModuleModes.MODE_THROTTLE = 0;
}

DECLARE_MODULE_AV1(charybdis, _modinit, _moddeinit, NULL, NULL, NULL, "$charybdis$");
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.