]>
Commit | Line | Data |
---|---|---|
212380e3 | 1 | Extended bans |
2 | Jilles Tjoelker <jilles -at- stack.nl> | |
3 | -------------------------------------- | |
4 | ||
5 | Extended bans (ban conditionals) allow different checks than the usual | |
6 | nick!user@host or nick!user@ip match to determine whether someone should | |
7 | be banned, quieted, exempted or invited. | |
8 | ||
9 | Extended bans are of the form $[~]<type>[:<data>]. The <type> is one | |
10 | character (case insensitive) and determines the type of match. Most types | |
11 | allow or require an extra field <data>. If the tilde (~) is present, the | |
12 | result of the comparison will be negated, unless the ban is invalid in which | |
13 | case it will never match. Invalid bans are ones where <data> is missing but | |
14 | required or where <data> is otherwise invalid as noted below. | |
15 | ||
16 | Unless noted below, all types can be used with +b, +q, +e and +I. | |
17 | ||
18 | If any extended ban types are loaded, they are listed in 005 (RPL_ISUPPORT) | |
19 | as EXTBAN=$:<types>. | |
20 | ||
21 | Local users cannot add extended bans of an unknown type or invalid bans. If a | |
22 | remote user adds an extended ban of an unknown type, the mode change is | |
23 | processed normally. Furthermore, extended bans of an unknown type can always be | |
24 | listed or removed. | |
25 | ||
26 | The ability to send to a channel is cached; this cache may not be updated | |
27 | if a condition for an extended ban changes. To work around this, part and | |
28 | rejoin the channel, or add or remove a +b, +q or +e entry. | |
29 | ||
30 | The extban types that come with charybdis are: | |
31 | ||
32 | extb_account.so | |
33 | $a | |
34 | matches all logged in users | |
35 | $a:<mask> | |
36 | matches users logged in with a username matching the mask (* and ? wildcards) | |
37 | ||
38 | extb_channel.so | |
39 | $c:<channel> | |
40 | matches users who are on the given channel; this is only valid if the channel | |
41 | exists and is not +s or +p. (The ops of the channel the ban is on cannot | |
42 | necessarily see whether the user is in the target channel, so it should not | |
43 | influence whether they can join either.) | |
44 | ||
45 | extb_oper.so | |
46 | $o | |
47 | matches opers (most useful with +I) | |
48 | ||
49 | extb_realname.so | |
50 | $r:<mask> | |
51 | matches users with a realname (gecos) matching the mask (* and ? wildcards); | |
52 | this can only be used with +b and +q | |
53 | ||
54 | extb_server.so | |
55 | $s:<mask> | |
56 | matches users connected to a server matching the mask (* and ? wildcards); | |
57 | this can only be used with +b and +q | |
58 | ||
59 | Comparisons: | |
60 | ||
61 | +b $~a is similar to +r but also prevents not logged in users talking or | |
62 | changing their nick while on channel. | |
63 | ||
64 | +iI $o is the same as +O in dreamforge-derived ircds. | |
65 | ||
66 | Creating extban types: | |
67 | ||
68 | extban_table, indexed by the extban character, contains function pointers | |
69 | of the following type: | |
70 | typedef int (*ExtbanFunc)(const char *data, struct Client *client_p, | |
71 | struct Channel *chptr, long mode_type); | |
72 | ||
73 | The arguments are as follows: | |
74 | data: the text after the colon, NULL if there was no colon | |
75 | client_p: the client to check; this is always a local client, which may be | |
76 | on or off channel | |
77 | chptr: the channel | |
78 | mode_type: CHFL_BAN, CHFL_QUIET, CHFL_EXCEPTION or CHFL_INVEX | |
79 | ||
80 | The return value: | |
81 | EXTBAN_INVALID: the mask is invalid, it never matches even if negated and | |
82 | cannot be added; if this is returned for one client_p it must be returned | |
83 | for all | |
84 | EXTBAN_NOMATCH: the client_p does not match the mask | |
85 | EXTBAN_MATCH: the client_p matches the mask | |
86 | ||
87 | The function is called whenever a (local) client needs to be checked against | |
88 | a +bqeI entry of the given extban type, and whenever a local client tries to | |
89 | add such an entry. (Clients are allowed to add bans matching themselves.) | |
90 | ||
91 | -- | |
92 | $Id: extban.txt 1639 2006-06-04 23:26:47Z jilles $ |