Source

shadowircd / unsupported / make_override_immune.c

#include "stdinc.h"
#include "modules.h"
#include "hook.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
#include "numeric.h"
#include "chmode.h"
#include "s_newconf.h"

static void can_kick(hook_data_channel_approval *);

mapi_hfn_list_av1 nooperkick_hfnlist[] = {
	{ "can_kick", (hookfn) can_kick },
	{ NULL, NULL }
};

DECLARE_MODULE_AV1(chm_no_oper_kick, NULL, NULL, NULL, NULL, nooperkick_hfnlist, "$Revision$");

static void
can_kick(hook_data_channel_approval *data)
{
	struct Client *source_p = data->client;
	struct Client *target_p = data->target;
	struct Channel *chptr = data->chptr;

	if (target_p->umodes & UMODE_OVERRIDE && data->approved)
	{
		sendto_one_numeric(source_p, ERR_ISCHANSERVICE,
				"%s %s :User is immune from kick.",
				target_p->name, chptr->chname);
		sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Overriding KICK from %s on %s in %s (user is immune)",
			source_p->name, target_p->name, chptr->chname);
		data->approved = 0;
	}
}
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.