From dc164bda2d37aad50c70584b97630a6c7f8e4288 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 24 May 2025 14:39:21 +0100 Subject: Allow services to remove all SVSHOLDs using one command. This is useful for reducing traffic on services shutdown. --- modules/services.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'modules/services.cpp') diff --git a/modules/services.cpp b/modules/services.cpp index 93bdcc57e..b93afc702 100644 --- a/modules/services.cpp +++ b/modules/services.cpp @@ -310,9 +310,16 @@ public: if (parameters.size() == 1) { - // :36DAAAAAA SVSHOLD ChanServ - std::string reason; - return ServerInstance->XLines->DelLine(parameters[0], "SVSHOLD", reason, user) ? CmdResult::SUCCESS : CmdResult::FAILURE; + if (irc::equals(parameters[0], "*")) + { + ServerInstance->XLines->DelAll("SVSHOLD", true); + } + else + { + // :36DAAAAAA SVSHOLD ChanServ + std::string reason; + return ServerInstance->XLines->DelLine(parameters[0], "SVSHOLD", reason, user) ? CmdResult::SUCCESS : CmdResult::FAILURE; + } } if (parameters.size() == 3) @@ -674,7 +681,7 @@ public: ~ModuleServices() override { - ServerInstance->XLines->DelAll("SVSHOLD"); + ServerInstance->XLines->DelAll("SVSHOLD", true); ServerInstance->XLines->UnregisterFactory(&svsholdfactory); } -- cgit v1.3.1-10-gc9f91