]>
Commit | Line | Data |
---|---|---|
1dd6d55d | 1 | /* Automatically generated by refactor.pl. |
2 | * | |
3 | * | |
4 | * CMDNAME: unbanmask | |
5 | * CMDLEVEL: QCMD_AUTHED | |
6 | * CMDARGS: 2 | |
7 | * CMDDESC: Removes bans matching a particular mask from a channel. | |
8 | * CMDFUNC: csc_dounbanmask | |
9 | * CMDPROTO: int csc_dounbanmask(void *source, int cargc, char **cargv); | |
1e32d528 | 10 | * CMDHELP: Usage: UNBANMASK <channel> <mask> |
11 | * CMDHELP: Removes any bans on the channel which are overlapped by the named mask. Can | |
12 | * CMDHELP: remove both channel bans and registered bans. Where: | |
13 | * CMDHELP: channel - channel to use | |
14 | * CMDHELP: mask - mask to remove. Any ban subsumed by this mask will be removed. For | |
15 | * CMDHELP: example, UNBANMASK *!*@*.isp.net would remove *!*@host1.isp.net and | |
16 | * CMDHELP: *!*@host2.isp.net and *!user@*.isp.net. | |
17 | * CMDHELP: UNBANMASK requires operator (+o) access on the named channel. | |
18 | * CMDHELP: Removing registered bans requires master (+m) access on the named channel. | |
1dd6d55d | 19 | */ |
20 | ||
21 | #include "../chanserv.h" | |
22 | #include "../../nick/nick.h" | |
23 | #include "../../lib/flags.h" | |
24 | #include "../../lib/irc_string.h" | |
25 | #include "../../channel/channel.h" | |
26 | #include "../../parser/parser.h" | |
27 | #include "../../irc/irc.h" | |
28 | #include "../../localuser/localuserchannel.h" | |
29 | #include <string.h> | |
30 | #include <stdio.h> | |
31 | ||
32 | int csc_dounbanmask(void *source, int cargc, char **cargv) { | |
33 | nick *sender=source; | |
34 | chanindex *cip; | |
336765cd | 35 | struct chanban *theban; |
1dd6d55d | 36 | |
37 | if (cargc<2) { | |
38 | chanservstdmessage(sender, QM_NOTENOUGHPARAMS, "unbanmask"); | |
39 | return CMD_ERROR; | |
40 | } | |
41 | ||
42 | if (!(cip=cs_checkaccess(sender, cargv[0], CA_OPPRIV, NULL, "unbanmask", 0, 0))) | |
43 | return CMD_ERROR; | |
44 | ||
1dd6d55d | 45 | theban=makeban(cargv[1]); |
336765cd | 46 | /* nice cast here */ |
0a53499c | 47 | cs_unbanfn(sender, cip, (UnbanFN)banoverlap, theban, 1, 0); |
336765cd | 48 | cs_log(sender,"UNBANMASK %s",bantostring(theban)); |
bf8c8dd4 | 49 | freechanban(theban); |
1dd6d55d | 50 | |
1dd6d55d | 51 | chanservstdmessage(sender, QM_DONE); |
52 | return CMD_OK; | |
53 | } |