| 1 |
michael |
9234 |
/* |
| 2 |
|
|
* ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd) |
| 3 |
|
|
* |
| 4 |
|
|
* Copyright (c) 2015-2016 plexus development team |
| 5 |
|
|
* Copyright (c) 2019-2020 ircd-hybrid development team |
| 6 |
|
|
* |
| 7 |
|
|
* This program is free software; you can redistribute it and/or modify |
| 8 |
|
|
* it under the terms of the GNU General Public License as published by |
| 9 |
|
|
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
|
|
* (at your option) any later version. |
| 11 |
|
|
* |
| 12 |
|
|
* This program is distributed in the hope that it will be useful, |
| 13 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
|
|
* GNU General Public License for more details. |
| 16 |
|
|
* |
| 17 |
|
|
* You should have received a copy of the GNU General Public License |
| 18 |
|
|
* along with this program; if not, write to the Free Software |
| 19 |
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 |
| 20 |
|
|
* USA |
| 21 |
|
|
*/ |
| 22 |
|
|
|
| 23 |
|
|
/*! \file extban_account.c |
| 24 |
|
|
* \brief Implements services account based extended channel bans. |
| 25 |
michael |
9238 |
* \version $Id$ |
| 26 |
michael |
9234 |
*/ |
| 27 |
|
|
|
| 28 |
|
|
#include "stdinc.h" |
| 29 |
|
|
#include "list.h" |
| 30 |
|
|
#include "irc_string.h" |
| 31 |
|
|
#include "channel.h" |
| 32 |
|
|
#include "channel_mode.h" |
| 33 |
|
|
#include "client.h" |
| 34 |
|
|
#include "extban.h" |
| 35 |
|
|
|
| 36 |
|
|
|
| 37 |
|
|
static enum extban_match |
| 38 |
|
|
extban_account_matches(struct Client *client_p, struct Channel *channel, struct Ban *ban) |
| 39 |
|
|
{ |
| 40 |
michael |
9244 |
assert(client_p->account[0]); |
| 41 |
|
|
|
| 42 |
|
|
if (irccmp(client_p->account, "*")) |
| 43 |
michael |
9234 |
if (match(ban->host, client_p->account) == 0) |
| 44 |
|
|
return EXTBAN_MATCH; |
| 45 |
|
|
|
| 46 |
|
|
return EXTBAN_NO_MATCH; |
| 47 |
|
|
} |
| 48 |
|
|
|
| 49 |
|
|
struct Extban extban_account = |
| 50 |
|
|
{ |
| 51 |
|
|
.character = 'a', |
| 52 |
|
|
.type = EXTBAN_MATCHING, |
| 53 |
|
|
.types = CHFL_BAN | CHFL_EXCEPTION | CHFL_INVEX, |
| 54 |
|
|
.matches = extban_account_matches |
| 55 |
|
|
}; |