From e95f77bc9981b3e232899e8ff5e7d140efed92b7 Mon Sep 17 00:00:00 2001 From: peavey Date: Mon, 5 May 2008 02:37:38 +0000 Subject: [PATCH] oops, fix this one. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9633 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_timedbans.cpp | 17 ++++++++--------- 1 file 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 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 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); -- 2.39.5