summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-05-31 21:00:43 +0100
committerSadie Powell <sadie@witchery.services>2021-05-31 21:00:43 +0100
commit95955ae0693310a4f70aa885a1772a021ad1a213 (patch)
tree4928a75e2a18c59422c75119afb185d208a1e532
parentdf4313f5bbacbfcb6592b6d90fe5362192287d59 (diff)
Rename nickserv:passlen to nickserv:maxpasslen.
-rw-r--r--data/nickserv.example.conf2
-rw-r--r--docs/Changes.conf4
-rw-r--r--modules/commands/ns_register.cpp6
-rw-r--r--modules/commands/ns_set.cpp12
4 files changed, 14 insertions, 10 deletions
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf
index bb9b8fec8..53307f33f 100644
--- a/data/nickserv.example.conf
+++ b/data/nickserv.example.conf
@@ -213,7 +213,7 @@ module
*
* This directive is optional. If not set it defaults to 32.
*/
- passlen = 32
+ maxpasslen = 32
}
/*
diff --git a/docs/Changes.conf b/docs/Changes.conf
index 662829ca3..6a530436b 100644
--- a/docs/Changes.conf
+++ b/docs/Changes.conf
@@ -1,3 +1,7 @@
+Anope Version 2.1.0-git
+--------------------
+Renamed nickserv:passlen to nickserv:maxpasslen.
+
Anope Version 2.0.10-git
--------------------
diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp
index 6fd66a33f..bf59ad1d0 100644
--- a/modules/commands/ns_register.cpp
+++ b/modules/commands/ns_register.cpp
@@ -192,7 +192,7 @@ class CommandNSRegister : public Command
}
}
- unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
+ unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
if (Config->GetModule("nickserv")->Get<bool>("forceemail", "yes") && email.empty())
this->OnSyntaxError(source, "");
@@ -202,8 +202,8 @@ class CommandNSRegister : public Command
source.Reply(NICK_ALREADY_REGISTERED, u_nick.c_str());
else if (pass.equals_ci(u_nick) || (Config->GetBlock("options")->Get<bool>("strictpasswords") && pass.length() < 5))
source.Reply(MORE_OBSCURE_PASSWORD);
- else if (pass.length() > passlen)
- source.Reply(PASSWORD_TOO_LONG, passlen);
+ else if (pass.length() > maxpasslen)
+ source.Reply(PASSWORD_TOO_LONG, maxpasslen);
else if (!email.empty() && !Mail::Validate(email))
source.Reply(MAIL_X_INVALID, email.c_str());
else
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index eefca82f6..22f74703c 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -137,10 +137,10 @@ class CommandNSSetPassword : public Command
return;
}
- unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
- if (len > passlen)
+ unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
+ if (len > maxpasslen)
{
- source.Reply(PASSWORD_TOO_LONG, passlen);
+ source.Reply(PASSWORD_TOO_LONG, maxpasslen);
return;
}
@@ -199,10 +199,10 @@ class CommandNSSASetPassword : public Command
return;
}
- unsigned int passlen = Config->GetModule("nickserv")->Get<unsigned>("passlen", "32");
- if (len > passlen)
+ unsigned int maxpasslen = Config->GetModule("nickserv")->Get<unsigned>("maxpasslen", "32");
+ if (len > maxpasslen)
{
- source.Reply(PASSWORD_TOO_LONG, passlen);
+ source.Reply(PASSWORD_TOO_LONG, maxpasslen);
return;
}