mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
Check the connection state of a command before the parameter count.
Works around a bug in irssi. Closes #2103.
This commit is contained in:
parent
591cb8e0b9
commit
0617fdfb65
@ -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))
|
if ((!command_p.empty()) && (command_p.back().empty()) && (!handler->allow_empty_last_param))
|
||||||
command_p.pop_back();
|
command_p.pop_back();
|
||||||
|
|
||||||
@ -298,14 +306,6 @@ void CommandParser::ProcessCommand(LocalUser* user, std::string& command, Comman
|
|||||||
user->CommandFloodPenalty += failpenalty;
|
user->CommandFloodPenalty += failpenalty;
|
||||||
handler->TellNotEnoughParameters(user, command_p);
|
handler->TellNotEnoughParameters(user, command_p);
|
||||||
FOREACH_MOD(OnCommandBlocked, (command, command_p, user));
|
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
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user