summaryrefslogtreecommitdiff
path: root/modules/memoserv
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-12-01 09:25:53 -0500
committerAdam <Adam@anope.org>2016-12-01 09:25:53 -0500
commitca28f9cfcbff0fbdb2afe96f1427245f83db7c47 (patch)
treeac5de801a4db01a7cb689ec670537ad74c7c53e6 /modules/memoserv
parent2f512281029fbf4f7ef9832e05804831ad2d9ba2 (diff)
Allow objects to opt out of gc, don't gc accounts with users logged in
Also store cached state with the field by using Serialize::Storage for field storage
Diffstat (limited to 'modules/memoserv')
-rw-r--r--modules/memoserv/main/ignore.h7
-rw-r--r--modules/memoserv/main/memo.h11
-rw-r--r--modules/memoserv/main/memoinfo.h9
3 files changed, 12 insertions, 15 deletions
diff --git a/modules/memoserv/main/ignore.h b/modules/memoserv/main/ignore.h
index 3c632a74e..9edca514b 100644
--- a/modules/memoserv/main/ignore.h
+++ b/modules/memoserv/main/ignore.h
@@ -23,12 +23,11 @@ class IgnoreImpl : public MemoServ::Ignore
{
friend class IgnoreType;
- MemoServ::MemoInfo *memoinfo = nullptr;
- Anope::string mask;
+ Serialize::Storage<MemoServ::MemoInfo *> memoinfo;
+ Serialize::Storage<Anope::string> mask;
public:
- IgnoreImpl(Serialize::TypeBase *type) : MemoServ::Ignore(type) { }
- IgnoreImpl(Serialize::TypeBase *type, Serialize::ID id) : MemoServ::Ignore(type, id) { }
+ using MemoServ::Ignore::Ignore;
~IgnoreImpl();
MemoServ::MemoInfo *GetMemoInfo() override;
diff --git a/modules/memoserv/main/memo.h b/modules/memoserv/main/memo.h
index 7f34f90dd..e4f91a1ad 100644
--- a/modules/memoserv/main/memo.h
+++ b/modules/memoserv/main/memo.h
@@ -23,14 +23,13 @@ class MemoImpl : public MemoServ::Memo
{
friend class MemoType;
- MemoServ::MemoInfo *memoinfo = nullptr;
- Anope::string text, sender;
- time_t time = 0;
- bool unread = false, receipt = false;
+ Serialize::Storage<MemoServ::MemoInfo *> memoinfo;
+ Serialize::Storage<Anope::string> text, sender;
+ Serialize::Storage<time_t> time;
+ Serialize::Storage<bool> unread, receipt;
public:
- MemoImpl(Serialize::TypeBase *type) : MemoServ::Memo(type) { }
- MemoImpl(Serialize::TypeBase *type, Serialize::ID id) : MemoServ::Memo(type, id) { }
+ using MemoServ::Memo::Memo;
MemoServ::MemoInfo *GetMemoInfo() override;
void SetMemoInfo(MemoServ::MemoInfo *) override;
diff --git a/modules/memoserv/main/memoinfo.h b/modules/memoserv/main/memoinfo.h
index 3232262a3..cbe37e456 100644
--- a/modules/memoserv/main/memoinfo.h
+++ b/modules/memoserv/main/memoinfo.h
@@ -23,13 +23,12 @@ class MemoInfoImpl : public MemoServ::MemoInfo
{
friend class MemoInfoType;
- Serialize::Object *owner = nullptr;
- int16_t memomax = 0;
- bool hardmax = false;
+ Serialize::Storage<Serialize::Object *> owner;
+ Serialize::Storage<int16_t> memomax;
+ Serialize::Storage<bool> hardmax;
public:
- MemoInfoImpl(Serialize::TypeBase *type) : MemoServ::MemoInfo(type) { }
- MemoInfoImpl(Serialize::TypeBase *type, Serialize::ID id) : MemoServ::MemoInfo(type, id) { }
+ using MemoServ::MemoInfo::MemoInfo;
MemoServ::Memo *GetMemo(unsigned index) override;
unsigned GetIndex(MemoServ::Memo *m) override;