]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Add ISUPPORT tokens for the host, line, and user length.
authorPeter Powell <petpow@saberuk.com>
Sun, 3 Dec 2017 13:40:33 +0000 (13:40 +0000)
committerPeter Powell <petpow@saberuk.com>
Sat, 23 Dec 2017 12:18:27 +0000 (12:18 +0000)
This allows clients to accurately predict the maximum safe length
of a NOTICE or PRIVMSG and truncate/split as appropriate.

As proposed at https://defs.ircdocs.horse/defs/isupport.html

src/server.cpp

index cd0889fb2226993d3df5498b6e2604e49a39bcb4..ff8f6211fbaa663cc2399a56c9f2f396649e5859 100644 (file)
@@ -190,7 +190,9 @@ void ISupportManager::Build()
        tokens["CHANMODES"] = ServerInstance->Modes->GiveModeList(MODETYPE_CHANNEL);
        tokens["CHANNELLEN"] = ConvToStr(ServerInstance->Config->Limits.ChanMax);
        tokens["CHANTYPES"] = "#";
+       tokens["HOSTLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxHost);
        tokens["KICKLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxKick);
+       tokens["LINELEN"] = ConvToStr(ServerInstance->Config->Limits.MaxLine);
        tokens["MAXTARGETS"] = ConvToStr(ServerInstance->Config->MaxTargets);
        tokens["MODES"] = ConvToStr(ServerInstance->Config->Limits.MaxModes);
        tokens["NETWORK"] = ServerInstance->Config->Network;
@@ -198,6 +200,7 @@ void ISupportManager::Build()
        tokens["PREFIX"] = ServerInstance->Modes->BuildPrefixes();
        tokens["STATUSMSG"] = ServerInstance->Modes->BuildPrefixes(false);
        tokens["TOPICLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxTopic);
+       tokens["USERLEN"] = ConvToStr(ServerInstance->Config->Limits.IdentMax);
        tokens["VBANLIST"];
 
        // Modules can add new tokens and also edit or remove existing tokens