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

Modernize the initialisation of NickAlias and NickCore.

This commit is contained in:
Sadie Powell
2024-03-09 12:20:15 +00:00
parent 51e95d72e3
commit 272104af95
3 changed files with 24 additions and 28 deletions
+6 -8
View File
@@ -20,22 +20,20 @@
Serialize::Checker<nickalias_map> NickAliasList("NickAlias");
NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore) : Serializable("NickAlias")
NickAlias::NickAlias(const Anope::string &nickname, NickCore *nickcore)
: Serializable("NickAlias")
, nick(nickname)
, nc(nickcore)
{
if (nickname.empty())
throw CoreException("Empty nick passed to NickAlias constructor");
else if (!nickcore)
throw CoreException("Empty nickcore passed to NickAlias constructor");
this->time_registered = this->last_seen = Anope::CurTime;
this->nick = nickname;
this->nc = nickcore;
nickcore->aliases->push_back(this);
size_t old = NickAliasList->size();
(*NickAliasList)[this->nick] = this;
if (old == NickAliasList->size())
Log(LOG_DEBUG) << "Duplicate nick " << nickname << " in nickalias table";
if (!NickAliasList->insert_or_assign(this->nick, this).second)
Log(LOG_DEBUG) << "Duplicate nick " << this->nick << " in NickAlias table";
if (this->nc->o == NULL)
{