aboutsummaryrefslogtreecommitdiffstats
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-09 15:44:38 +0100
committerGravatar Sadie Powell2024-09-09 15:48:02 +0100
commit6204c9636e8ea87d690e1e7c06cbf35d04083586 (patch)
tree9d4e437bc9b5849fb85a716c6ddcea272b137822 /src/commands.cpp
parentMerge branch 'insp4' into master. (diff)
parentSend an ISupport diff when a user moves to a new connect class. (diff)
Merge branch 'insp4' into master.
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index 0637eab0d..6aa1885b1 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -2,7 +2,7 @@
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2021 Herman <GermanAizek@yandex.ru>
- * Copyright (C) 2018-2023 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2018-2024 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2012-2016, 2018 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
@@ -183,9 +183,9 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
if (!handler)
{
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, false));
- if (MOD_RESULT == MOD_RES_DENY)
+ ModResult modres;
+ FIRST_MOD_RESULT(OnPreCommand, modres, (command, command_p, user, false));
+ if (modres == MOD_RES_DENY)
{
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;
@@ -242,9 +242,9 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
* We call OnPreCommand here separately if the command exists, so the magic above can
* truncate to max_params if necessary. -- w00t
*/
- ModResult MOD_RESULT;
- FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, false));
- if (MOD_RESULT == MOD_RES_DENY)
+ ModResult modres;
+ FIRST_MOD_RESULT(OnPreCommand, modres, (command, command_p, user, false));
+ if (modres == MOD_RES_DENY)
{
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;
@@ -290,21 +290,21 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
}
}
- if ((!command_p.empty()) && (command_p.back().empty()) && (!handler->allow_empty_last_param))
- command_p.pop_back();
-
- if (command_p.size() < handler->min_params)
+ if (!user->IsFullyConnected() && !handler->works_before_reg)
{
user->CommandFloodPenalty += failpenalty;
- handler->TellNotEnoughParameters(user, command_p);
+ handler->TellNotFullyConnected(user, command_p);
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;
}
- if (!user->IsFullyConnected() && !handler->works_before_reg)
+ if ((!command_p.empty()) && (command_p.back().empty()) && (!handler->allow_empty_last_param))
+ command_p.pop_back();
+
+ if (command_p.size() < handler->min_params)
{
user->CommandFloodPenalty += failpenalty;
- handler->TellNotFullyConnected(user, command_p);
+ handler->TellNotEnoughParameters(user, command_p);
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
}
else
@@ -313,8 +313,8 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
handler->use_count++;
/* module calls too */
- FIRST_MOD_RESULT(OnPreCommand, MOD_RESULT, (command, command_p, user, true));
- if (MOD_RESULT == MOD_RES_DENY)
+ FIRST_MOD_RESULT(OnPreCommand, modres, (command, command_p, user, true));
+ if (modres == MOD_RES_DENY)
{
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;