From befecafad372234b3f3791cdcaa2685c6ab02070 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 10 Dec 2022 11:41:53 +0000 Subject: Allow specifying multiple masks when adding an X-line. The only exemptions for this are RLINE (a real name might contains commas) and SVSHOLD (sent by services only). Closes #1972. --- src/coremods/core_xline/cmd_eline.cpp | 6 ++++-- src/coremods/core_xline/cmd_gline.cpp | 6 ++++-- src/coremods/core_xline/cmd_kline.cpp | 6 ++++-- src/coremods/core_xline/cmd_qline.cpp | 5 ++++- src/coremods/core_xline/cmd_zline.cpp | 6 ++++-- src/modules/m_shun.cpp | 5 +++-- 6 files changed, 23 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/coremods/core_xline/cmd_eline.cpp b/src/coremods/core_xline/cmd_eline.cpp index c55c1e853..8002d04a0 100644 --- a/src/coremods/core_xline/cmd_eline.cpp +++ b/src/coremods/core_xline/cmd_eline.cpp @@ -33,15 +33,17 @@ CommandEline::CommandEline(Module* parent) : Command(parent, "ELINE", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } /** Handle /ELINE */ CmdResult CommandEline::Handle(User* user, const Params& parameters) { - std::string target = parameters[0]; + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; + std::string target = parameters[0]; if (parameters.size() >= 3) { IdentHostPair ih; diff --git a/src/coremods/core_xline/cmd_gline.cpp b/src/coremods/core_xline/cmd_gline.cpp index 34401f685..8f9c418b1 100644 --- a/src/coremods/core_xline/cmd_gline.cpp +++ b/src/coremods/core_xline/cmd_gline.cpp @@ -34,15 +34,17 @@ CommandGline::CommandGline(Module* parent) : Command(parent, "GLINE", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } /** Handle /GLINE */ CmdResult CommandGline::Handle(User* user, const Params& parameters) { - std::string target = parameters[0]; + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; + std::string target = parameters[0]; if (parameters.size() >= 3) { IdentHostPair ih; diff --git a/src/coremods/core_xline/cmd_kline.cpp b/src/coremods/core_xline/cmd_kline.cpp index b182bfc73..99498018e 100644 --- a/src/coremods/core_xline/cmd_kline.cpp +++ b/src/coremods/core_xline/cmd_kline.cpp @@ -34,15 +34,17 @@ CommandKline::CommandKline(Module* parent) : Command(parent, "KLINE", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } /** Handle /KLINE */ CmdResult CommandKline::Handle(User* user, const Params& parameters) { - std::string target = parameters[0]; + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; + std::string target = parameters[0]; if (parameters.size() >= 3) { IdentHostPair ih; diff --git a/src/coremods/core_xline/cmd_qline.cpp b/src/coremods/core_xline/cmd_qline.cpp index 8d802d88d..b6fd91a21 100644 --- a/src/coremods/core_xline/cmd_qline.cpp +++ b/src/coremods/core_xline/cmd_qline.cpp @@ -35,11 +35,14 @@ CommandQline::CommandQline(Module* parent) : Command(parent, "QLINE", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } CmdResult CommandQline::Handle(User* user, const Params& parameters) { + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; + if (parameters.size() >= 3) { NickMatcher matcher; diff --git a/src/coremods/core_xline/cmd_zline.cpp b/src/coremods/core_xline/cmd_zline.cpp index 4a4740900..3b852b0d5 100644 --- a/src/coremods/core_xline/cmd_zline.cpp +++ b/src/coremods/core_xline/cmd_zline.cpp @@ -35,13 +35,15 @@ CommandZline::CommandZline(Module* parent) : Command(parent, "ZLINE", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } CmdResult CommandZline::Handle(User* user, const Params& parameters) { - std::string target = parameters[0]; + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; + std::string target = parameters[0]; if (parameters.size() >= 3) { if (target.find('!') != std::string::npos) diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index a09ebd44d..e1f3df1d2 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -62,16 +62,17 @@ class CommandShun : public Command CommandShun(Module* Creator) : Command(Creator, "SHUN", 1, 3) { flags_needed = 'o'; - syntax = " [ :]"; + syntax = "[,]+ [ :]"; } CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE { /* syntax: SHUN nick!user@host time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ + if (CommandParser::LoopCall(user, this, parameters, 0)) + return CMD_SUCCESS; std::string target = parameters[0]; - User *find = ServerInstance->FindNick(target); if ((find) && (find->registered == REG_ALL)) target = "*!" + find->GetBanIdent() + "@" + find->GetIPString(); -- cgit v1.3.1-10-gc9f91