From cbc5431d62e3fe9166f18395dce3ddf2af0906d3 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 28 Mar 2026 21:32:23 +0000 Subject: Switch modules from reference<> to shared_ptr<> and weak_ptr<>. --- modules/messageflood.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/messageflood.cpp') diff --git a/modules/messageflood.cpp b/modules/messageflood.cpp index 622501d4e..dee018d6a 100644 --- a/modules/messageflood.cpp +++ b/modules/messageflood.cpp @@ -150,7 +150,7 @@ private: } public: - MsgFlood(Module* Creator) + MsgFlood(const WeakModulePtr& Creator) : ParamMode>(Creator, "flood", 'f') { syntax = "{ban|block|mute|kick|kickban}::"; @@ -244,10 +244,10 @@ private: public: ModuleMsgFlood() : Module(VF_VENDOR, "Adds channel mode f (flood) which helps protect against spammers which mass-message channels.") - , CTCTags::EventListener(this) - , banmode(this, "ban") - , exemptionprov(this) - , mf(this) + , CTCTags::EventListener(weak_from_this()) + , banmode(weak_from_this(), "ban") + , exemptionprov(weak_from_this()) + , mf(weak_from_this()) { } @@ -345,7 +345,7 @@ public: void Prioritize() override { // we want to be after all modules that might deny the message (e.g. m_muteban, m_noctcp, m_blockcolor, etc.) - ServerInstance->Modules.SetPriority(this, I_OnUserPreMessage, PRIORITY_LAST); + ServerInstance->Modules.SetPriority(shared_from_this(), I_OnUserPreMessage, PRIORITY_LAST); } }; -- cgit v1.3.1-10-gc9f91