Check the connection state of a command before the parameter count.

Works around a bug in irssi.

Closes #2103.
This commit is contained in:
Sadie Powell 2024-09-03 19:00:49 +01:00
parent 591cb8e0b9
commit 0617fdfb65

View File

@ -290,6 +290,14 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
}
}
if (!user->IsFullyConnected() && !handler->works_before_reg)
{
user->CommandFloodPenalty += failpenalty;
handler->TellNotFullyConnected(user, command_p);
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;
}
if ((!command_p.empty()) && (command_p.back().empty()) && (!handler->allow_empty_last_param))
command_p.pop_back();
@ -298,14 +306,6 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
user->CommandFloodPenalty += failpenalty;
handler->TellNotEnoughParameters(user, command_p);
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
return;
}
if (!user->IsFullyConnected() && !handler->works_before_reg)
{
user->CommandFloodPenalty += failpenalty;
handler->TellNotFullyConnected(user, command_p);
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
}
else
{