diff options
author | Sadie Powell <sadie@witchery.services> | 2024-05-11 17:33:42 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-05-11 17:40:38 +0100 |
commit | 4008e64f26531383029cdb747b456d515d367ad6 (patch) | |
tree | dd76b234ef043f1594ae965c9812eae0eb1d2ae7 /src | |
parent | 1cf5918574468c04c93f588b63b3531ea5768a89 (diff) |
Store when the account name was registered in the NickCore.
Diffstat (limited to 'src')
-rw-r--r-- | src/nickalias.cpp | 3 | ||||
-rw-r--r-- | src/nickcore.cpp | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/nickalias.cpp b/src/nickalias.cpp index edd38a23c..cfcd13381 100644 --- a/src/nickalias.cpp +++ b/src/nickalias.cpp @@ -216,6 +216,9 @@ Serializable *NickAlias::Unserialize(Serializable *obj, Serialize::Data &data) data["extensible:NO_EXPIRE"] >> b; if (b) na->Extend<bool>("NS_NO_EXPIRE"); + + if (na->time_registered < na->nc->time_registered) + na->nc->time_registered = na->time_registered; /* end compat */ return na; diff --git a/src/nickcore.cpp b/src/nickcore.cpp index 5629b00fd..64aa4f504 100644 --- a/src/nickcore.cpp +++ b/src/nickcore.cpp @@ -73,7 +73,9 @@ void NickCore::Serialize(Serialize::Data &data) const data["pass"] << this->pass; data["email"] << this->email; data["language"] << this->language; - data["lastmail"] << this->lastmail; + data.SetType("lastmail", Serialize::Data::DT_INT); data["lastmail"] << this->lastmail; + data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered; + data["memomax"] << this->memos.memomax; for (const auto &ignore : this->memos.ignores) data["memoignores"] << ignore << " "; @@ -99,6 +101,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data) data["email"] >> nc->email; data["language"] >> nc->language; data["lastmail"] >> nc->lastmail; + data["time_registered"] >> nc->time_registered; data["memomax"] >> nc->memos.memomax; { Anope::string buf; @@ -206,14 +209,7 @@ uint64_t NickCore::GetId() if (this->id) return this->id; - NickAlias *na = NickAlias::Find(this->display); - if (!na) - { - Log(LOG_DEBUG) << "Unable to find the display NickAlias for NickCore: " << this->display; - return 0; - } - - Anope::string secretid = this->display + "\0" + Anope::ToString(na->time_registered); + Anope::string secretid = this->display + "\0" + Anope::ToString(this->time_registered); // Generate the account id. This should almost always only have one // iteration but in the rare case that we generate a duplicate id we try |