diff options
-rw-r--r-- | include/account.h | 2 | ||||
-rw-r--r-- | language/anope.en_US.po | 12 | ||||
-rw-r--r-- | modules/database/db_atheme.cpp | 3 | ||||
-rw-r--r-- | modules/nickserv/ns_info.cpp | 3 | ||||
-rw-r--r-- | modules/webcpanel/pages/nickserv/info.cpp | 2 | ||||
-rw-r--r-- | src/nickalias.cpp | 3 | ||||
-rw-r--r-- | src/nickcore.cpp | 14 |
7 files changed, 24 insertions, 15 deletions
diff --git a/include/account.h b/include/account.h index fcc715135..b6a69cfcf 100644 --- a/include/account.h +++ b/include/account.h @@ -130,6 +130,8 @@ public: Anope::string language; /* Last time an email was sent to this user */ time_t lastmail = 0; + /* The time this account was registered */ + time_t time_registered = Anope::CurTime; MemoInfo memos; std::map<Anope::string, Anope::string> last_modes; diff --git a/language/anope.en_US.po b/language/anope.en_US.po index 36bd6e185..b270e0165 100644 --- a/language/anope.en_US.po +++ b/language/anope.en_US.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: Anope\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-07 15:51+0100\n" -"PO-Revision-Date: 2024-04-07 15:51+0100\n" +"POT-Creation-Date: 2024-05-11 17:38+0100\n" +"PO-Revision-Date: 2024-05-11 17:39+0100\n" "Last-Translator: Sadie Powell <sadie@witchery.services>\n" "Language-Team: English\n" "Language: en_US\n" @@ -16,7 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.4\n" +"X-Generator: Poedit 3.4.2\n" #, c-format msgid "%d channel(s) cleared, and %d channel(s) dropped." @@ -1812,6 +1812,9 @@ msgstr "Account" msgid "Account %s has already reached the maximum number of simultaneous logins (%u)." msgstr "Account %s has already reached the maximum number of simultaneous logins (%u)." +msgid "Account registered" +msgstr "Account registered" + msgid "Accounts can not be registered right now. Please try again later." msgstr "Accounts can not be registered right now. Please try again later." @@ -5141,6 +5144,9 @@ msgstr "Nick %s is now released." msgid "Nick %s is now suspended." msgstr "Nick %s is now suspended." +msgid "Nick registered" +msgstr "Nick registered" + #, c-format msgid "Nick too long, max length is %zu characters." msgstr "Nick too long, max length is %zu characters." diff --git a/modules/database/db_atheme.cpp b/modules/database/db_atheme.cpp index 60870f7a7..ee1d390c2 100644 --- a/modules/database/db_atheme.cpp +++ b/modules/database/db_atheme.cpp @@ -1131,7 +1131,7 @@ private: auto display = row.Get(); auto pass = row.Get(); auto email = row.Get(); - /* auto regtime = */ row.GetNum<time_t>(); + auto regtime = row.GetNum<time_t>(); /* auto lastlogin = */ row.Get(); auto flags = row.Get(); auto language = row.Get(); @@ -1141,6 +1141,7 @@ private: auto *nc = new NickCore(display); nc->email = email; + nc->time_registered = regtime; ApplyPassword(nc, flags, pass); // No equivalent: bglmNQrS diff --git a/modules/nickserv/ns_info.cpp b/modules/nickserv/ns_info.cpp index 771b3a890..8a27af8b6 100644 --- a/modules/nickserv/ns_info.cpp +++ b/modules/nickserv/ns_info.cpp @@ -88,7 +88,8 @@ public: info[_("Last seen address")] = na->last_realhost; } - info[_("Registered")] = Anope::strftime(na->time_registered, source.GetAccount()); + info[_("Account registered")] = Anope::strftime(na->nc->time_registered, source.GetAccount()); + info[_("Nick registered")] = Anope::strftime(na->time_registered, source.GetAccount()); if (!nick_online) info[_("Last seen")] = Anope::strftime(na->last_seen, source.GetAccount()); diff --git a/modules/webcpanel/pages/nickserv/info.cpp b/modules/webcpanel/pages/nickserv/info.cpp index 9b2a2f112..a5eb18a1a 100644 --- a/modules/webcpanel/pages/nickserv/info.cpp +++ b/modules/webcpanel/pages/nickserv/info.cpp @@ -103,7 +103,7 @@ bool WebCPanel::NickServ::Info::OnRequest(HTTPProvider *server, const Anope::str replacements["DISPLAY"] = na->nc->display; if (!na->nc->email.empty()) replacements["EMAIL"] = na->nc->email; - replacements["TIME_REGISTERED"] = Anope::strftime(na->time_registered, na->nc); + replacements["TIME_REGISTERED"] = Anope::strftime(na->nc->time_registered, na->nc); if (na->HasVHost()) replacements["VHOST"] = na->GetVHostMask(); Anope::string *greet = na->nc->GetExt<Anope::string>("greet"); 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 |