1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 07:53:12 +02:00

When assigning a new display nick use the oldest not the first.

This commit is contained in:
Sadie Powell
2025-06-20 19:19:12 +01:00
parent a4abd27ffd
commit 21c8164539
3 changed files with 17 additions and 7 deletions
+11 -1
View File
@@ -190,7 +190,17 @@ Serializable *NickCore::Type::Unserialize(Serializable *obj, Serialize::Data &da
void NickCore::SetDisplay(NickAlias *na)
{
if (na->nc != this || na->nick == this->display)
// If no nick is specified then pick the oldest one.
if (!na)
{
for (auto *alias : *this->aliases)
{
if (!na || alias->registered < na->registered)
na = alias;
}
}
if (!na || na->nc != this || na->nick == this->display)
return;
FOREACH_MOD(OnChangeCoreDisplay, (this, na->nick));