From c1aa1d5a2b34b6a3339a157af3031b553fb8dd05 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 17 Mar 2021 17:26:55 +0000 Subject: Add a subclass of ExtensionItem exclusively for booleans. --- src/modules/m_delayjoin.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/modules/m_delayjoin.cpp') diff --git a/src/modules/m_delayjoin.cpp b/src/modules/m_delayjoin.cpp index 3e3b3c228..84bc576be 100644 --- a/src/modules/m_delayjoin.cpp +++ b/src/modules/m_delayjoin.cpp @@ -31,10 +31,10 @@ class DelayJoinMode : public ModeHandler { private: - IntExtItem& unjoined; + BoolExtItem& unjoined; public: - DelayJoinMode(Module* Parent, IntExtItem& ext) + DelayJoinMode(Module* Parent, BoolExtItem& ext) : ModeHandler(Parent, "delayjoin", 'D', PARAM_NONE, MODETYPE_CHANNEL) , unjoined(ext) { @@ -56,10 +56,11 @@ namespace */ class JoinHook : public ClientProtocol::EventHook { - const IntExtItem& unjoined; + private: + const BoolExtItem& unjoined; public: - JoinHook(Module* mod, const IntExtItem& unjoinedref) + JoinHook(Module* mod, const BoolExtItem& unjoinedref) : ClientProtocol::EventHook(mod, "JOIN", 10) , unjoined(unjoinedref) { @@ -84,7 +85,7 @@ class ModuleDelayJoin , public Names::EventListener { public: - IntExtItem unjoined; + BoolExtItem unjoined; JoinHook joinhook; DelayJoinMode djm; @@ -156,7 +157,7 @@ static void populate(CUList& except, Membership* memb) void ModuleDelayJoin::OnUserJoin(Membership* memb, bool sync, bool created, CUList& except) { if (memb->chan->IsModeSet(djm)) - unjoined.Set(memb, 1); + unjoined.Set(memb); } void ModuleDelayJoin::OnUserPart(Membership* memb, std::string &partmessage, CUList& except) -- cgit v1.3.1-10-gc9f91