summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-03-09 13:14:57 +0000
committerSadie Powell <sadie@witchery.services>2024-03-09 22:22:55 +0000
commit9ead3f15c3256786d3c2b485a786ad32faa0a438 (patch)
tree38840b28d8becbd531da0f4c889e9de5ffab30b0
parent272104af957b3dc38c11137d6c1e63f86e2cf64c (diff)
Save the last email time for accounts.
-rw-r--r--include/account.h4
-rw-r--r--src/nickcore.cpp2
2 files changed, 4 insertions, 2 deletions
diff --git a/include/account.h b/include/account.h
index 9a862c3b1..9a59cb913 100644
--- a/include/account.h
+++ b/include/account.h
@@ -128,6 +128,8 @@ public:
Anope::string email;
/* Locale name of the language of the user. Empty means default language */
Anope::string language;
+ /* Last time an email was sent to this user */
+ time_t lastmail = 0;
MemoInfo memos;
std::map<Anope::string, Anope::string> last_modes;
@@ -143,8 +145,6 @@ public:
/* Number of channels registered by this account */
uint16_t channelcount = 0;
- /* Last time an email was sent to this user */
- time_t lastmail = 0;
/* Users online now logged into this account */
std::list<User *> users;
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index c60a238b4..ae9e15334 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -73,6 +73,7 @@ void NickCore::Serialize(Serialize::Data &data) const
data["pass"] << this->pass;
data["email"] << this->email;
data["language"] << this->language;
+ data["lastmail"] << this->lastmail;
data["memomax"] << this->memos.memomax;
for (const auto &ignore : this->memos.ignores)
data["memoignores"] << ignore << " ";
@@ -97,6 +98,7 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
data["pass"] >> nc->pass;
data["email"] >> nc->email;
data["language"] >> nc->language;
+ data["lastmail"] >> nc->lastmail;
data["memomax"] >> nc->memos.memomax;
{
Anope::string buf;