summaryrefslogtreecommitdiff
path: root/src/core/cs_ban.c
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-11 23:59:18 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2009-02-11 23:59:18 +0000
commit4836d9548d8078fa53b854cc5510820922e8211b (patch)
treeb1aef4653b8225d0acd694972d18cad663b5aca7 /src/core/cs_ban.c
parent394d3b9325e6498b7aca1ac12b5c76fa329f95ac (diff)
Audit cs_ban, cs_clear, cs_drop.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2017 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/core/cs_ban.c')
-rw-r--r--src/core/cs_ban.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/core/cs_ban.c b/src/core/cs_ban.c
index c72e45ff8..51288fa6e 100644
--- a/src/core/cs_ban.c
+++ b/src/core/cs_ban.c
@@ -31,7 +31,7 @@ void myChanServHelp(User * u)
class CommandCSBan : public Command
{
public:
- CommandCSBan() : Command("BAN", 1, 3)
+ CommandCSBan() : Command("BAN", 2, 3)
{
}
@@ -40,24 +40,24 @@ class CommandCSBan : public Command
{
const char *chan = params[0].c_str();
const char *target = params[1].c_str();
- params[2].resize(200);
- const char *reason = params[2].c_str();
+ const char *reason = NULL;
+
+ if (params.size() > 2)
+ {
+ params[2].resize(200);
+ reason = params[2].c_str();
+
+ }
Channel *c;
ChannelInfo *ci;
User *u2;
- if (!chan)
- return MOD_CONT;
-
int is_same;
if (!reason)
reason = "Requested";
- if (!target)
- target = u->nick;
-
is_same = (stricmp(target, u->nick) == 0);
if (!(c = findchan(chan))) {
@@ -119,6 +119,12 @@ class CommandCSBan : public Command
notice_lang(s_ChanServ, u, CHAN_HELP_BAN);
return true;
}
+
+ void OnSyntaxError(User *u)
+ {
+ // XXX: temporary, this can be tackled when the language system isn't so goddamn hairy.
+ syntax_error(s_ChanServ, u, "BAN", CHAN_UNBAN_SYNTAX);
+ }
};
@@ -133,7 +139,7 @@ class CommandCSUnban : public Command
CommandReturn Execute(User *u, std::vector<std::string> &params)
{
- char *chan = strtok(NULL, " ");
+ const char *chan = params[0].c_str();
Channel *c;
ChannelInfo *ci;