diff options
| author | 2026-03-28 21:32:23 +0000 | |
|---|---|---|
| committer | 2026-03-29 00:42:15 +0000 | |
| commit | cbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch) | |
| tree | 48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/messageflood.cpp | |
| parent | Move service code from base to its own header. (diff) | |
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/messageflood.cpp')
| -rw-r--r-- | modules/messageflood.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<MsgFlood, SimpleExtItem<MsgFloodSettings>>(Creator, "flood", 'f') { syntax = "{ban|block|mute|kick|kickban}:<messages>:<period>"; @@ -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); } }; |
