mirror of
https://github.com/anope/anope.git
synced 2026-06-12 19:14:47 +02:00
If the IRCd sends a field limit then use it over that of the config.
This commit is contained in:
+13
-16
@@ -28,23 +28,21 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
||||
|
||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
||||
if (nick.length() > IRCD->GetMaxNick())
|
||||
{
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), networkinfo->Get<unsigned>("nicklen"));
|
||||
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
||||
if (user.length() > IRCD->GetMaxUser())
|
||||
{
|
||||
source.Reply(_("Bot idents may only be %d characters long."), networkinfo->Get<unsigned>("userlen"));
|
||||
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
|
||||
return;
|
||||
}
|
||||
|
||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), networkinfo->Get<unsigned>("hostlen"));
|
||||
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -120,23 +118,22 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
Configuration::Block *networkinfo = Config->GetBlock("networkinfo");
|
||||
|
||||
if (nick.length() > networkinfo->Get<unsigned>("nicklen"))
|
||||
if (nick.length() > IRCD->GetMaxNick())
|
||||
{
|
||||
source.Reply(_("Bot nicks may only be %d characters long."), networkinfo->Get<unsigned>("nicklen"));
|
||||
source.Reply(_("Bot nicks may only be %zu characters long."), IRCD->GetMaxNick());
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.length() > networkinfo->Get<unsigned>("userlen"))
|
||||
if (user.length() > IRCD->GetMaxUser())
|
||||
{
|
||||
source.Reply(_("Bot idents may only be %d characters long."), networkinfo->Get<unsigned>("userlen"));
|
||||
source.Reply(_("Bot idents may only be %zu characters long."), IRCD->GetMaxUser());
|
||||
return;
|
||||
}
|
||||
|
||||
if (host.length() > networkinfo->Get<unsigned>("hostlen"))
|
||||
if (host.length() > IRCD->GetMaxHost())
|
||||
{
|
||||
source.Reply(_("Bot hosts may only be %d characters long."), networkinfo->Get<unsigned>("hostlen"));
|
||||
source.Reply(_("Bot hosts may only be %zu characters long."), IRCD->GetMaxHost()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user