diff options
| author | 2022-12-10 11:41:53 +0000 | |
|---|---|---|
| committer | 2022-12-10 12:26:18 +0000 | |
| commit | befecafad372234b3f3791cdcaa2685c6ab02070 (patch) | |
| tree | 76ea2bcf48688db0223b8ba39432cd6531307664 | |
| parent | Fix building with the Intel C++ compiler. (diff) | |
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.
| -rw-r--r-- | docs/conf/helpop.conf.example | 12 | ||||
| -rw-r--r-- | src/coremods/core_xline/cmd_eline.cpp | 6 | ||||
| -rw-r--r-- | src/coremods/core_xline/cmd_gline.cpp | 6 | ||||
| -rw-r--r-- | src/coremods/core_xline/cmd_kline.cpp | 6 | ||||
| -rw-r--r-- | src/coremods/core_xline/cmd_qline.cpp | 5 | ||||
| -rw-r--r-- | src/coremods/core_xline/cmd_zline.cpp | 6 | ||||
| -rw-r--r-- | src/modules/m_shun.cpp | 5 |
7 files changed, 29 insertions, 17 deletions
diff --git a/docs/conf/helpop.conf.example b/docs/conf/helpop.conf.example index 1e930461c..6bc225207 100644 --- a/docs/conf/helpop.conf.example +++ b/docs/conf/helpop.conf.example @@ -680,7 +680,7 @@ Changes the real name of the user to the specified real name. Changes the ident of the user to the specified ident. "> -<helpop key="shun" title="/SHUN <nick!user@host> [<duration> :<reason>]" value=" +<helpop key="shun" title="/SHUN <nick!user@host>[,<nick!user@host>]+ [<duration> :<reason>]" value=" Sets or removes a shun (global server-side ignore) on a nick!user@host mask. You must specify all three parameters to add a shun, and one parameter to remove a shun (just the nick!user@host). @@ -753,7 +753,7 @@ Unloads a module from all linked servers. Unloads and reloads a module on all linked servers. "> -<helpop key="kline" title="/KLINE <user@host> [<duration> :<reason>]" value=" +<helpop key="kline" title="/KLINE <user@host>[,<user@host>]+ [<duration> :<reason>]" value=" Sets or removes a K-line (local user@host based ban) on a user@host mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the user@host). @@ -763,7 +763,7 @@ The duration may be specified in seconds, or in the format five minutes and six seconds. All fields in this format are optional. "> -<helpop key="zline" title="/ZLINE <ipmask> [<duration> :<reason>]" value=" +<helpop key="zline" title="/ZLINE <ipmask>[,<ipmask>]+ [<duration> :<reason>]" value=" Sets or removes a Z-line (global IP based ban) on an IP mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the ipmask). @@ -773,7 +773,7 @@ The duration may be specified in seconds, or in the format five minutes and six seconds. All fields in this format are optional. "> -<helpop key="qline" title="/QLINE <nickmask> [<duration> :<reason>]" value=" +<helpop key="qline" title="/QLINE <nickmask>[,<nickmask>]+ [<duration> :<reason>]" value=" Sets or removes a Q-line (global nick based ban) on a nick mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the nickmask). @@ -783,7 +783,7 @@ The duration may be specified in seconds, or in the format five minutes and six seconds. All fields in this format are optional. "> -<helpop key="gline" title="/GLINE <user@host> [<duration> :<reason>]" value=" +<helpop key="gline" title="/GLINE <user@host>[,<user@host>]+ [<duration> :<reason>]" value=" Sets or removes a G-line (global user@host based ban) on a user@host mask. You must specify all three parameters to add a ban, and one parameter to remove a ban (just the user@host). @@ -793,7 +793,7 @@ The duration may be specified in seconds, or in the format five minutes and six seconds. All fields in this format are optional. "> -<helpop key="eline" title="/ELINE <user@host> [<duration> :<reason>]" value=" +<helpop key="eline" title="/ELINE <user@host>[,<user@host>]+ [<duration> :<reason>]" value=" Sets or removes a E-line (global user@host ban exception) on a user@host mask. You must specify at least 3 parameters to add an exception, and one parameter to remove an exception (just the user@host). 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 = "<user@host> [<duration> :<reason>]"; + syntax = "<user@host>[,<user@host>]+ [<duration> :<reason>]"; } /** 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 = "<user@host> [<duration> :<reason>]"; + syntax = "<user@host>[,<user@host>]+ [<duration> :<reason>]"; } /** 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 = "<user@host> [<duration> :<reason>]"; + syntax = "<user@host>[,<user@host>]+ [<duration> :<reason>]"; } /** 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 = "<nickmask> [<duration> :<reason>]"; + syntax = "<nickmask>[,<nickmask>]+ [<duration> :<reason>]"; } 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 = "<ipmask> [<duration> :<reason>]"; + syntax = "<ipmask>[,<ipmask>]+ [<duration> :<reason>]"; } 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 = "<nick!user@host> [<duration> :<reason>]"; + syntax = "<nick!user@host>[,<nick!user@host>]+ [<duration> :<reason>]"; } 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(); |
