diff options
| author | 2021-03-17 17:26:55 +0000 | |
|---|---|---|
| committer | 2021-03-17 21:14:07 +0000 | |
| commit | c1aa1d5a2b34b6a3339a157af3031b553fb8dd05 (patch) | |
| tree | 5b4090c8603f734ae8c6f230351afcd94190bb9d /src/modules/m_delayjoin.cpp | |
| parent | Implement support for automatically syncing extension items. (diff) | |
| download | inspircd++-c1aa1d5a2b34b6a3339a157af3031b553fb8dd05.tar.gz inspircd++-c1aa1d5a2b34b6a3339a157af3031b553fb8dd05.tar.bz2 inspircd++-c1aa1d5a2b34b6a3339a157af3031b553fb8dd05.zip | |
Add a subclass of ExtensionItem exclusively for booleans.
Diffstat (limited to 'src/modules/m_delayjoin.cpp')
| -rw-r--r-- | src/modules/m_delayjoin.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
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) |
