diff options
| author | Sadie Powell <sadie@witchery.services> | 2024-11-24 23:56:57 +0000 |
|---|---|---|
| committer | Sadie Powell <sadie@witchery.services> | 2024-11-25 00:08:30 +0000 |
| commit | 7019b27e591e0f5ce3727993e02198ae070885e9 (patch) | |
| tree | 7752a85bb31f4bce07f63c3364a9f8d6c903daa2 /modules/nickserv/ns_register.cpp | |
| parent | 70227dc8823c0f9669e35dbf63593faaeef5410d (diff) | |
Rework how guest nicks work.
- Use the config setting as a string template instead of as a prefix.
- Allow users of IRCds that have UIDs to use that as the guest nick.
- Fall back to a UID before killing if a guest nick can not be found.
Diffstat (limited to 'modules/nickserv/ns_register.cpp')
| -rw-r--r-- | modules/nickserv/ns_register.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/modules/nickserv/ns_register.cpp b/modules/nickserv/ns_register.cpp index 4775fc594..692371c0e 100644 --- a/modules/nickserv/ns_register.cpp +++ b/modules/nickserv/ns_register.cpp @@ -13,6 +13,8 @@ static bool SendRegmail(User *u, const NickAlias *na, BotInfo *bi); +static ServiceReference<NickServService> nickserv("NickServService", "NickServ"); + class CommandNSConfirm final : public Command { @@ -133,7 +135,6 @@ public: { User *u = source.GetUser(); Anope::string u_nick = source.GetNick(); - size_t nicklen = u_nick.length(); Anope::string pass = params[0]; Anope::string email = params.size() > 1 ? params[1] : ""; const Anope::string &nsregister = Config->GetModule(this->owner)->Get<const Anope::string>("registration"); @@ -160,13 +161,7 @@ public: return; } - /* Prevent "Guest" nicks from being registered. -TheShadow */ - - /* Guest nick can now have a series of between 1 and 7 digits. - * --lara - */ - const Anope::string &guestnick = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest"); - if (nicklen <= guestnick.length() + 7 && nicklen >= guestnick.length() + 1 && !u_nick.find_ci(guestnick) && u_nick.substr(guestnick.length()).find_first_not_of("1234567890") == Anope::string::npos) + if (nickserv && nickserv->IsGuestNick(u_nick)) { source.Reply(NICK_CANNOT_BE_REGISTERED, u_nick.c_str()); return; |
