summaryrefslogtreecommitdiff
path: root/modules/protocol/ngircd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol/ngircd.cpp')
-rw-r--r--modules/protocol/ngircd.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
index 6dfb91b6c..3c80fecc6 100644
--- a/modules/protocol/ngircd.cpp
+++ b/modules/protocol/ngircd.cpp
@@ -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;
}
}
}