1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 12:53:14 +02:00

Simplify limit extraction code.

This commit is contained in:
Sadie Powell
2024-03-12 12:22:57 +00:00
parent 63d682314b
commit 06add0e5fc
12 changed files with 58 additions and 121 deletions
+12 -12
View File
@@ -28,21 +28,21 @@ private:
return;
}
if (nick.length() > IRCD->GetMaxNick())
if (nick.length() > IRCD->MaxNick)
{
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->MaxNick);
return;
}
if (user.length() > IRCD->GetMaxUser())
if (user.length() > IRCD->MaxUser)
{
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->MaxUser);
return;
}
if (host.length() > IRCD->GetMaxHost())
if (host.length() > IRCD->MaxHost)
{
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost());
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->MaxHost);
return;
}
@@ -118,21 +118,21 @@ private:
return;
}
if (nick.length() > IRCD->GetMaxNick())
if (nick.length() > IRCD->MaxNick)
{
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->MaxNick);
return;
}
if (user.length() > IRCD->GetMaxUser())
if (user.length() > IRCD->MaxUser)
{
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->MaxUser);
return;
}
if (host.length() > IRCD->GetMaxHost())
if (host.length() > IRCD->MaxHost)
{
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost()
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->MaxHost
);
return;
}