1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 04:26:38 +02:00

If the IRCd sends a field limit then use it over that of the config.

This commit is contained in:
Sadie Powell
2024-02-22 15:58:23 +00:00
parent 84ad85ee85
commit c4e9c0bf85
22 changed files with 251 additions and 163 deletions
+11 -5
View File
@@ -11,6 +11,11 @@
#include "module.h"
namespace
{
size_t nicklen = 0;
}
class ngIRCdProto final
: public IRCDProto
{
@@ -31,6 +36,11 @@ public:
MaxModes = 5;
}
size_t GetMaxNick() override
{
return nicklen ? nicklen : IRCDProto::GetMaxNick();
}
void SendAkill(User *u, XLine *x) override
{
// Calculate the time left before this would expire
@@ -172,11 +182,7 @@ struct IRCDMessage005 final
}
else if (parameter == "NICKLEN")
{
unsigned newlen = convertTo<unsigned>(data), len = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen");
if (len != newlen)
{
Log() << "Warning: NICKLEN is " << newlen << " but networkinfo:nicklen is " << len;
}
nicklen = data.is_pos_number_only() ? convertTo<size_t>(data) : 0;
}
}
}