1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 14:56:39 +02:00

Fix suggesting unloaded commands in the "did you mean" message.

This commit is contained in:
Sadie Powell
2025-06-21 09:56:02 +01:00
parent 66ae20e0f2
commit ad06853edf
+6 -2
View File
@@ -229,12 +229,16 @@ namespace
auto umessage = message.upper();
for (const auto &[command, info] : source.service->commands)
{
if (info.hide || command == message)
continue; // Don't suggest a hidden alias or a missing command.
if (info.hide)
continue; // Don't suggest a hidden alias.
size_t dist = Anope::Distance(umessage, command);
if (dist < distance)
{
ServiceReference<Command> cmd("Command", info.name);
if (!cmd)
continue; // Don't suggest an unloaded command.
distance = dist;
similar = command;
}