mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
Rename IdentMax to MaxUser for consistency with the other limits.
This commit is contained in:
parent
fc8628592a
commit
7187fc224b
@ -129,8 +129,8 @@ class ServerLimits
|
||||
size_t ChanMax;
|
||||
/** Maximum number of modes per line */
|
||||
size_t MaxModes;
|
||||
/** Maximum length of ident, not including ~ etc */
|
||||
size_t IdentMax;
|
||||
/** Maximum length of a username (ident) */
|
||||
size_t MaxUser;
|
||||
/** Maximum length of a quit message */
|
||||
size_t MaxQuit;
|
||||
/** Maximum topic length */
|
||||
@ -150,7 +150,7 @@ class ServerLimits
|
||||
ServerLimits(std::shared_ptr<ConfigTag> tag);
|
||||
|
||||
/** Maximum length of a n!u\@h mask */
|
||||
size_t GetMaxMask() const { return NickMax + 1 + IdentMax + 1 + MaxHost; }
|
||||
size_t GetMaxMask() const { return NickMax + 1 + MaxUser + 1 + MaxHost; }
|
||||
};
|
||||
|
||||
struct CommandLineConf
|
||||
|
@ -42,7 +42,7 @@ ServerLimits::ServerLimits(std::shared_ptr<ConfigTag> tag)
|
||||
, NickMax(tag->getUInt("maxnick", 30, 1, MaxLine))
|
||||
, ChanMax(tag->getUInt("maxchan", 64, 1, MaxLine))
|
||||
, MaxModes(tag->getUInt("maxmodes", 20, 1))
|
||||
, IdentMax(tag->getUInt("maxident", 10, 1))
|
||||
, MaxUser(tag->getUInt("maxident", 10, 1))
|
||||
, MaxQuit(tag->getUInt("maxquit", 255, 0, MaxLine))
|
||||
, MaxTopic(tag->getUInt("maxtopic", 307, 1, MaxLine))
|
||||
, MaxKick(tag->getUInt("maxkick", 255, 1, MaxLine))
|
||||
|
@ -88,7 +88,7 @@ void ISupportManager::Build()
|
||||
{ "PREFIX", ServerInstance->Modes.BuildPrefixes() },
|
||||
{ "STATUSMSG", ServerInstance->Modes.BuildPrefixes(false) },
|
||||
{ "TOPICLEN", ConvToStr(ServerInstance->Config->Limits.MaxTopic) },
|
||||
{ "USERLEN", ConvToStr(ServerInstance->Config->Limits.IdentMax) },
|
||||
{ "USERLEN", ConvToStr(ServerInstance->Config->Limits.MaxUser) },
|
||||
};
|
||||
isupportevprov.Call(&ISupport::EventListener::OnBuildISupport, tokens);
|
||||
|
||||
|
@ -50,7 +50,7 @@ class CommandChgident : public Command
|
||||
return CmdResult::FAILURE;
|
||||
}
|
||||
|
||||
if (parameters[1].length() > ServerInstance->Config->Limits.IdentMax)
|
||||
if (parameters[1].length() > ServerInstance->Config->Limits.MaxUser)
|
||||
{
|
||||
user->WriteNotice("*** CHGIDENT: Ident is too long");
|
||||
return CmdResult::FAILURE;
|
||||
|
@ -238,7 +238,7 @@ class IdentRequestSocket : public EventHandler
|
||||
/* Truncate the ident at any characters we don't like, skip leading spaces */
|
||||
for (std::string::const_iterator i = buf.begin()+lastcolon+1; i != buf.end(); ++i)
|
||||
{
|
||||
if (result.size() == ServerInstance->Config->Limits.IdentMax)
|
||||
if (result.size() == ServerInstance->Config->Limits.MaxUser)
|
||||
/* Ident is getting too long */
|
||||
break;
|
||||
|
||||
@ -290,8 +290,8 @@ class ModuleIdent : public Module
|
||||
newident.insert(newident.begin(), '~');
|
||||
|
||||
// If the username is too long then truncate it.
|
||||
if (newident.length() > ServerInstance->Config->Limits.IdentMax)
|
||||
newident.erase(ServerInstance->Config->Limits.IdentMax);
|
||||
if (newident.length() > ServerInstance->Config->Limits.MaxUser)
|
||||
newident.erase(ServerInstance->Config->Limits.MaxUser);
|
||||
|
||||
// Apply the new username.
|
||||
user->ChangeIdent(newident);
|
||||
|
@ -40,7 +40,7 @@ class CommandSetident : public Command
|
||||
|
||||
CmdResult Handle(User* user, const Params& parameters) override
|
||||
{
|
||||
if (parameters[0].size() > ServerInstance->Config->Limits.IdentMax)
|
||||
if (parameters[0].size() > ServerInstance->Config->Limits.MaxUser)
|
||||
{
|
||||
user->WriteNotice("*** SETIDENT: Ident is too long");
|
||||
return CmdResult::FAILURE;
|
||||
|
@ -163,7 +163,7 @@ void TreeSocket::SendCapabilities(int phase)
|
||||
":NICKMAX="+ConvToStr(ServerInstance->Config->Limits.NickMax)+
|
||||
" CHANMAX="+ConvToStr(ServerInstance->Config->Limits.ChanMax)+
|
||||
" MAXMODES="+ConvToStr(ServerInstance->Config->Limits.MaxModes)+
|
||||
" IDENTMAX="+ConvToStr(ServerInstance->Config->Limits.IdentMax)+
|
||||
" IDENTMAX="+ConvToStr(ServerInstance->Config->Limits.MaxUser)+
|
||||
" MAXQUIT="+ConvToStr(ServerInstance->Config->Limits.MaxQuit)+
|
||||
" MAXTOPIC="+ConvToStr(ServerInstance->Config->Limits.MaxTopic)+
|
||||
" MAXKICK="+ConvToStr(ServerInstance->Config->Limits.MaxKick)+
|
||||
|
@ -1078,7 +1078,7 @@ bool User::ChangeIdent(const std::string& newident)
|
||||
|
||||
FOREACH_MOD(OnChangeIdent, (this,newident));
|
||||
|
||||
this->ident.assign(newident, 0, ServerInstance->Config->Limits.IdentMax);
|
||||
this->ident.assign(newident, 0, ServerInstance->Config->Limits.MaxUser);
|
||||
this->InvalidateCache();
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user