summaryrefslogtreecommitdiff
path: root/src/modules/m_timedbans.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-05 02:37:38 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-05 02:37:38 +0000
commite95f77bc9981b3e232899e8ff5e7d140efed92b7 (patch)
tree5a7f1fa19f5364d6e54d8fe1ecf028da4dbda19f /src/modules/m_timedbans.cpp
parent82a5be10d08744973c6cb3ba676c17124aa3f48c (diff)
oops, fix this one.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9633 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_timedbans.cpp')
-rw-r--r--src/modules/m_timedbans.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp
index d7e684622..40c994842 100644
--- a/src/modules/m_timedbans.cpp
+++ b/src/modules/m_timedbans.cpp
@@ -55,7 +55,7 @@ class CommandTban : public Command
}
for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
{
- if (!strcasecmp(i->data,parameters[2]))
+ if (!strcasecmp(i->data,parameters[2].c_str()))
{
user->WriteServ("NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0]));
return CMD_FAILURE;
@@ -71,13 +71,13 @@ class CommandTban : public Command
return CMD_FAILURE;
}
std::string mask = parameters[2];
- const char *setban[32];
+ std::vector<std::string> setban;
setban[0] = parameters[0];
setban[1] = "+b";
setban[2] = parameters[2];
// use CallCommandHandler to make it so that the user sets the mode
// themselves
- ServerInstance->CallCommandHandler("MODE",setban,3,user);
+ ServerInstance->CallCommandHandler("MODE",setban,user);
/* Check if the ban was actually added (e.g. banlist was NOT full) */
bool was_added = false;
for (BanList::iterator i = channel->bans.begin(); i != channel->bans.end(); i++)
@@ -101,7 +101,7 @@ class CommandTban : public Command
ServerInstance->Config->AllowHalfop ? " half-" : " channel ");
return CMD_FAILURE;
}
- user->WriteNumeric(401, "%s %s :No such channel",user->nick, parameters[0]);
+ user->WriteNumeric(401, "%s %s :No such channel",user->nick, parameters[0].c_str());
return CMD_FAILURE;
}
};
@@ -157,12 +157,11 @@ class ModuleTimedBans : public Module
Channel* cr = ServerInstance->FindChan(safei->channel);
if (cr)
{
- const char *setban[3];
std::string mask = safei->mask;
-
- setban[0] = safei->channel.c_str();
+ std::vector<std::string> setban;
+ setban[0] = safei->channel;
setban[1] = "-b";
- setban[2] = mask.c_str();
+ setban[2] = mask;
CUList empty;
cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :*** Timed ban on %s expired.", cr->name, safei->mask.c_str());
@@ -171,7 +170,7 @@ class ModuleTimedBans : public Module
/* Removes the ban item for us, no ::erase() needed */
ServerInstance->PI->SendModeStr(safei->channel, std::string("-b ") + setban[2]);
- ServerInstance->SendMode(setban, 3, ServerInstance->FakeClient);
+ ServerInstance->SendMode(setban, ServerInstance->FakeClient);
if (ServerInstance->Modes->GetLastParse().empty())
TimedBanList.erase(safei);