-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move privset extban to $O and add $o extban for oper name
- Loading branch information
Showing
3 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Oper name extban type: matches oper names | ||
* -- jilles | ||
*/ | ||
|
||
#include "stdinc.h" | ||
#include "modules.h" | ||
#include "client.h" | ||
#include "privilege.h" | ||
#include "s_newconf.h" | ||
#include "ircd.h" | ||
|
||
static const char extb_desc[] = "Oper name ($o) extban type"; | ||
|
||
static int _modinit(void); | ||
static void _moddeinit(void); | ||
static int eb_opername(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type); | ||
|
||
DECLARE_MODULE_AV2(extb_opername, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc); | ||
|
||
static int | ||
_modinit(void) | ||
{ | ||
extban_table['o'] = eb_opername; | ||
|
||
return 0; | ||
} | ||
|
||
static void | ||
_moddeinit(void) | ||
{ | ||
extban_table['o'] = NULL; | ||
} | ||
|
||
static int eb_opername(const char *data, struct Client *client_p, | ||
struct Channel *chptr, long mode_type) | ||
{ | ||
|
||
if (data != NULL) | ||
return match(client_p->user->opername, data)? EXTBAN_MATCH : EXTBAN_NOMATCH; | ||
return IsOper(client_p) ? EXTBAN_MATCH : EXTBAN_NOMATCH; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This cannot be used since channel bans are case insensitive and the code changes the extban letter to lowercase before looking it up in
extban_table
.