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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user