From 4634151efc02ff016e19c5f123d75824d0d6c811 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Wed, 3 Sep 2014 15:32:02 +0200 Subject: Replace irc::modestacker usage with the new ModeParser::Process() --- src/modules/m_timedbans.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/modules/m_timedbans.cpp') diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index e3a938336..803156446 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -71,17 +71,15 @@ class CommandTban : public Command return CMD_FAILURE; } std::string mask = parameters[2]; - std::vector setban; - setban.push_back(parameters[0]); - setban.push_back("+b"); bool isextban = ((mask.size() > 2) && (mask[1] == ':')); if (!isextban && !InspIRCd::IsValidMask(mask)) mask.append("!*@*"); - setban.push_back(mask); + Modes::ChangeList setban; + setban.push_add(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), mask); // Pass the user (instead of ServerInstance->FakeClient) to ModeHandler::Process() to // make it so that the user sets the mode themselves - ServerInstance->Modes->Process(setban, user); + ServerInstance->Modes->Process(user, channel, NULL, setban); if (ServerInstance->Modes->GetLastParse().empty()) { user->WriteNotice("Invalid ban mask"); @@ -169,17 +167,14 @@ class ModuleTimedBans : public Module Channel* cr = ServerInstance->FindChan(chan); if (cr) { - std::vector setban; - setban.push_back(chan); - setban.push_back("-b"); - setban.push_back(mask); - CUList empty; std::string expiry = "*** Timed ban on " + chan + " expired."; cr->WriteAllExcept(ServerInstance->FakeClient, true, '@', empty, "NOTICE %s :%s", cr->name.c_str(), expiry.c_str()); ServerInstance->PI->SendChannelNotice(cr, '@', expiry); - ServerInstance->Modes->Process(setban, ServerInstance->FakeClient); + Modes::ChangeList setban; + setban.push_remove(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), mask); + ServerInstance->Modes->Process(ServerInstance->FakeClient, cr, NULL, setban); } } } -- cgit v1.3.1-10-gc9f91