1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 20:33:13 +02:00

Allow server admins to require that a display nick drops last.

Closes #348.
This commit is contained in:
Sadie Powell
2024-08-29 13:14:39 +01:00
parent a3edb09eda
commit 58a78e9aa5
4 changed files with 16 additions and 0 deletions
+1
View File
@@ -746,6 +746,7 @@ log
* nickserv/cert - Can modify other users certificate lists
* nickserv/confirm - Can confirm other users nicknames
* nickserv/drop - Can drop other users nicks
* nickserv/drop/display - Allows dropping display nicks when preservedisplay is enabled
* nickserv/drop/override - Allows dropping nicks without using a confirmation code
* nickserv/recover - Can recover other users nicks
* operserv/config - Can modify services's configuration
+6
View File
@@ -219,6 +219,12 @@ module
* This directive is optional. If not set it defaults to 50.
*/
maxpasslen = 50
/*
* Whether all of the secondary nicks of a nick group have to expire or be
dropped before the display nick can expire or be dropped.
*/
preservedisplay = no
}
/*
+3
View File
@@ -536,6 +536,9 @@ public:
if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
expire = true;
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay"))
expire = false;
FOREACH_MOD(OnPreNickExpire, (na, expire));
if (expire)
+6
View File
@@ -57,6 +57,12 @@ public:
return;
}
if (na->nc->na == na && na->nc->aliases->size() > 1 && Config->GetModule("nickserv")->Get<bool>("preservedisplay") && !source.HasPriv("nickserv/drop/display"))
{
source.Reply(_("You may not drop \002%s\002 as it is the display nick for the account."), na->nick.c_str());
return;
}
auto *code = dropcode.Get(na);
if (params.size() < 2 || ((!code || !code->equals_ci(params[1])) && (!source.HasPriv("nickserv/drop/override") || params[1] != "OVERRIDE")))
{