0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 16:30:52 +01:00

extban $o: add support for matching against specific permissions.

Syntax: $o:oper:admin (match against the oper:admin permission)
This commit is contained in:
William Pitcock 2012-01-22 04:05:34 -06:00
parent 11f2e78727
commit 655e7dee45

View file

@ -8,6 +8,8 @@
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "privilege.h"
#include "s_newconf.h"
#include "ircd.h"
static int _modinit(void);
@ -36,9 +38,10 @@ static int eb_oper(const char *data, struct Client *client_p,
(void)chptr;
(void)mode_type;
/* perhaps use data somehow? (opernick/flags?) */
/* so deny any bans with data for now */
if (data != NULL)
return EXTBAN_INVALID;
return IsOper(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
return IsOper(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
/* $o:admin or whatever */
return HasPrivilege(client_p, data) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
}