summaryrefslogtreecommitdiff
path: root/include/account.h
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-12 10:29:11 +0000
committerSadie Powell <sadie@witchery.services>2025-03-12 15:53:52 +0000
commitcdcf0e2f9a8fb0e1c363fc65f71f3131fc6c5ea5 (patch)
tree3a665673235bb4dea58b99474492d90e0f711697 /include/account.h
parent718f2e922a6e1113d66fc6e96131213942d507b2 (diff)
Move serialization from Serializable to a Serialize::Type child.
Diffstat (limited to 'include/account.h')
-rw-r--r--include/account.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/account.h b/include/account.h
index 5c2e52fd2..02e71ac38 100644
--- a/include/account.h
+++ b/include/account.h
@@ -32,6 +32,16 @@ class CoreExport NickAlias final
: public Serializable
, public Extensible
{
+public:
+ struct Type final
+ : public Serialize::Type
+ {
+ Type();
+ void Serialize(const Serializable *obj, Serialize::Data &data) const override;
+ Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
+ };
+
+private:
Anope::string vhost_ident, vhost_host, vhost_creator;
time_t vhost_created = 0;
@@ -56,9 +66,6 @@ public:
NickAlias(const Anope::string &nickname, NickCore *nickcore);
~NickAlias();
- void Serialize(Serialize::Data &data) const override;
- static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
-
/** Set a vhost for the user
* @param ident The ident
* @param host The host
@@ -116,6 +123,16 @@ class CoreExport NickCore final
: public Serializable
, public Extensible
{
+public:
+ struct Type final
+ : public Serialize::Type
+ {
+ Type();
+ void Serialize(const Serializable *obj, Serialize::Data &data) const override;
+ Serializable *Unserialize(Serializable *obj, Serialize::Data &data) const override;
+ };
+
+private:
/* Channels which reference this core in some way (this is on their access list, akick list, is founder, successor, etc) */
Serialize::Checker<std::map<ChannelInfo *, int> > chanaccess;
/* Unique identifier for the account. */
@@ -159,9 +176,6 @@ public:
NickCore(const Anope::string &nickdisplay, uint64_t nickid = 0);
~NickCore();
- void Serialize(Serialize::Data &data) const override;
- static Serializable *Unserialize(Serializable *obj, Serialize::Data &);
-
/** Changes the display for this account
* @param na The new display, must be grouped to this account.
*/