From de2392833ec17a9deb865fdac0af73275fd960ff Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Sep 2022 21:09:09 +0100 Subject: Default allow_empty_last_param to false. --- src/coremods/core_channel/cmd_kick.cpp | 1 + src/coremods/core_channel/cmd_topic.cpp | 1 + src/coremods/core_info/cmd_servlist.cpp | 1 - src/coremods/core_list.cpp | 1 - src/coremods/core_message.cpp | 2 ++ src/coremods/core_stats.cpp | 1 - src/coremods/core_user/cmd_away.cpp | 1 - src/coremods/core_user/cmd_nick.cpp | 1 + src/coremods/core_user/cmd_part.cpp | 1 + src/coremods/core_user/cmd_quit.cpp | 1 + src/coremods/core_user/cmd_user.cpp | 1 - src/coremods/core_user/core_user.h | 2 -- src/coremods/core_wallops.cpp | 1 + src/coremods/core_who.cpp | 1 - src/modules/m_callerid.cpp | 1 - src/modules/m_chghost.cpp | 1 - src/modules/m_chgident.cpp | 1 - src/modules/m_chgname.cpp | 1 - src/modules/m_dccallow.cpp | 1 - src/modules/m_gateway.cpp | 2 -- src/modules/m_globalload.cpp | 3 --- src/modules/m_globops.cpp | 1 + src/modules/m_ircv3_ctctags.cpp | 1 - src/modules/m_monitor.cpp | 1 - src/modules/m_rmode.cpp | 1 - src/modules/m_sajoin.cpp | 1 - src/modules/m_sakick.cpp | 1 + src/modules/m_samode.cpp | 1 - src/modules/m_sanick.cpp | 1 - src/modules/m_sapart.cpp | 1 + src/modules/m_sasl.cpp | 1 - src/modules/m_satopic.cpp | 1 + src/modules/m_sethost.cpp | 1 - src/modules/m_setident.cpp | 1 - src/modules/m_setname.cpp | 1 - src/modules/m_silence.cpp | 1 - src/modules/m_spanningtree/override_map.cpp | 1 - src/modules/m_sslinfo.cpp | 1 - src/modules/m_swhois.cpp | 1 + src/modules/m_topiclock.cpp | 1 + src/modules/m_watch.cpp | 1 - 41 files changed, 14 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index bcce17cbd..35a84c51d 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -40,6 +40,7 @@ enum CommandKick::CommandKick(Module* parent) : Command(parent, "KICK", 2, 3) { + allow_empty_last_param = true; syntax = { " [,]+ [:]" }; } diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp index ff2a058ab..9a3f46ab2 100644 --- a/src/coremods/core_channel/cmd_topic.cpp +++ b/src/coremods/core_channel/cmd_topic.cpp @@ -46,6 +46,7 @@ CommandTopic::CommandTopic(Module* parent) , secretmode(parent, "secret") , topiclockmode(parent, "topiclock") { + allow_empty_last_param = true; syntax = { " [:]" }; Penalty = 2; } diff --git a/src/coremods/core_info/cmd_servlist.cpp b/src/coremods/core_info/cmd_servlist.cpp index b9e8c6656..9cb57ed53 100644 --- a/src/coremods/core_info/cmd_servlist.cpp +++ b/src/coremods/core_info/cmd_servlist.cpp @@ -32,7 +32,6 @@ CommandServList::CommandServList(Module* parent) : SplitCommand(parent, "SERVLIST") , invisiblemode(parent, "invisible") { - allow_empty_last_param = false; syntax = { "[ []]" }; } diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 6b30957f8..2c6253c45 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -55,7 +55,6 @@ public: , secretmode(creator, "secret") , privatemode(creator, "private") { - allow_empty_last_param = false; Penalty = 5; } diff --git a/src/coremods/core_message.cpp b/src/coremods/core_message.cpp index 481f4e325..b7b301153 100644 --- a/src/coremods/core_message.cpp +++ b/src/coremods/core_message.cpp @@ -277,6 +277,7 @@ public: : Command(parent, ClientProtocol::Messages::Privmsg::CommandStrFromMsgType(mt), 2, 2) , msgtype(mt) { + allow_empty_last_param = true; syntax = { "[,]+ :" }; } @@ -338,6 +339,7 @@ public: CommandSQuery(Module* Creator) : Command(Creator, "SQUERY", 2, 2) { + allow_empty_last_param = true; syntax = { " :" }; translation = { TR_NICK, TR_TEXT }; } diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp index 727fc1569..3fe7171b2 100644 --- a/src/coremods/core_stats.cpp +++ b/src/coremods/core_stats.cpp @@ -50,7 +50,6 @@ public: : Command(Creator, "STATS", 1, 2) , statsevprov(Creator, "event/stats") { - allow_empty_last_param = false; syntax = { " []" }; } diff --git a/src/coremods/core_user/cmd_away.cpp b/src/coremods/core_user/cmd_away.cpp index 3c72ecdf6..a5b8a0fa6 100644 --- a/src/coremods/core_user/cmd_away.cpp +++ b/src/coremods/core_user/cmd_away.cpp @@ -38,7 +38,6 @@ CommandAway::CommandAway(Module* parent) : Command(parent, "AWAY", 0, 1) , awayevprov(parent) { - allow_empty_last_param = false; syntax = { "[:]" }; } diff --git a/src/coremods/core_user/cmd_nick.cpp b/src/coremods/core_user/cmd_nick.cpp index 5cfd60018..46adea51d 100644 --- a/src/coremods/core_user/cmd_nick.cpp +++ b/src/coremods/core_user/cmd_nick.cpp @@ -37,6 +37,7 @@ enum CommandNick::CommandNick(Module* parent) : SplitCommand(parent, "NICK", 1) { + allow_empty_last_param = true; works_before_reg = true; syntax = { "" }; Penalty = 0; diff --git a/src/coremods/core_user/cmd_part.cpp b/src/coremods/core_user/cmd_part.cpp index 3fb25628a..1db5a6f37 100644 --- a/src/coremods/core_user/cmd_part.cpp +++ b/src/coremods/core_user/cmd_part.cpp @@ -33,6 +33,7 @@ CommandPart::CommandPart(Module* parent) : Command(parent, "PART", 1, 2) { + allow_empty_last_param = true; Penalty = 5; syntax = { "[,]+ [:]" }; } diff --git a/src/coremods/core_user/cmd_quit.cpp b/src/coremods/core_user/cmd_quit.cpp index b5e271405..22f0c2aef 100644 --- a/src/coremods/core_user/cmd_quit.cpp +++ b/src/coremods/core_user/cmd_quit.cpp @@ -30,6 +30,7 @@ CommandQuit::CommandQuit(Module* parent) : Command(parent, "QUIT", 0, 1) , operquit(parent, "operquit", ExtensionType::USER, true) { + allow_empty_last_param = true; works_before_reg = true; syntax = { "[:]" }; } diff --git a/src/coremods/core_user/cmd_user.cpp b/src/coremods/core_user/cmd_user.cpp index b114dd452..6018bf964 100644 --- a/src/coremods/core_user/cmd_user.cpp +++ b/src/coremods/core_user/cmd_user.cpp @@ -36,7 +36,6 @@ enum CommandUser::CommandUser(Module* parent) : SplitCommand(parent, "USER", 4, 4) { - allow_empty_last_param = false; works_before_reg = true; Penalty = 0; syntax = { " :" }; diff --git a/src/coremods/core_user/core_user.h b/src/coremods/core_user/core_user.h index 5997bafa1..619d0c4ba 100644 --- a/src/coremods/core_user/core_user.h +++ b/src/coremods/core_user/core_user.h @@ -73,7 +73,6 @@ public: CommandIson(Module* parent) : SplitCommand(parent, "ISON", 1) { - allow_empty_last_param = false; syntax = { " []+" }; } @@ -141,7 +140,6 @@ public: : Command(parent,"USERHOST", 1) , hideopermode(parent, "hideoper") { - allow_empty_last_param = false; syntax = { " []+" }; } diff --git a/src/coremods/core_wallops.cpp b/src/coremods/core_wallops.cpp index dced60c8a..5b08c35fe 100644 --- a/src/coremods/core_wallops.cpp +++ b/src/coremods/core_wallops.cpp @@ -38,6 +38,7 @@ public: , protoevprov(parent, name) { access_needed = CmdAccess::OPERATOR; + allow_empty_last_param = true; syntax = { ":" }; } diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp index f211b522d..bc527cfde 100644 --- a/src/coremods/core_who.cpp +++ b/src/coremods/core_who.cpp @@ -205,7 +205,6 @@ public: , whoevprov(parent, "event/who") , whomatchevprov(parent, "event/who-match") { - allow_empty_last_param = false; syntax = { "|||||0 [Aafhilmnoprstux]%[acdfhilnorstu]", " [Aafhilmnoprstux]%[acdfhilnorstu] :|||||0]" diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp index ccc4c3f08..3503b3554 100644 --- a/src/modules/m_callerid.cpp +++ b/src/modules/m_callerid.cpp @@ -188,7 +188,6 @@ public: CommandAccept(Module* Creator) : Command(Creator, "ACCEPT", 1), extInfo(Creator) { - allow_empty_last_param = false; syntax = { "*|(+|-)[,(+|-)]+" }; translation = { TR_CUSTOM }; } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 25b4dbc9e..f857ca5cd 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -35,7 +35,6 @@ public: CommandChghost(Module* Creator) : Command(Creator,"CHGHOST", 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { " " }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 5fe6daf46..5f247b4ff 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -35,7 +35,6 @@ class CommandChgident final public: CommandChgident(Module* Creator) : Command(Creator,"CHGIDENT", 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { " " }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index f9a311233..7448c8299 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -33,7 +33,6 @@ class CommandChgname final public: CommandChgname(Module* Creator) : Command(Creator,"CHGNAME", 2, 2) { - allow_empty_last_param = false; access_needed = CmdAccess::OPERATOR; syntax = { " :" }; translation = { TR_NICK, TR_TEXT }; diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 059c28761..c436f5b7d 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -194,7 +194,6 @@ public: : Command(parent, "DCCALLOW", 0) , ext(Ext) { - allow_empty_last_param = false; syntax = { "[(+|-) [