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/callerid.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'modules/callerid.cpp') diff --git a/modules/callerid.cpp b/modules/callerid.cpp index f89b1e9aa..ccbf70862 100644 --- a/modules/callerid.cpp +++ b/modules/callerid.cpp @@ -80,7 +80,7 @@ public: struct CallerIDExtInfo final : public ExtensionItem { - CallerIDExtInfo(Module* parent) + CallerIDExtInfo(const WeakModulePtr& parent) : ExtensionItem(parent, "callerid_data", ExtensionType::USER) { } @@ -189,7 +189,7 @@ class CommandAccept final public: CallerIDExtInfo extInfo; unsigned long maxaccepts; - CommandAccept(Module* Creator) + CommandAccept(const WeakModulePtr& Creator) : Command(Creator, "ACCEPT", 1) , extInfo(Creator) { @@ -344,7 +344,7 @@ private: CallerIDExtInfo& ext; public: - CallerIDAPIImpl(Module* Creator, CallerIDExtInfo& Ext) + CallerIDAPIImpl(const WeakModulePtr& Creator, CallerIDExtInfo& Ext) : CallerID::APIBase(Creator) , ext(Ext) { @@ -395,11 +395,11 @@ private: public: ModuleCallerID() : Module(VF_VENDOR | VF_COMMON, "Provides user mode g (callerid) which allows users to require that other users are on their whitelist before messaging them.") - , CTCTags::EventListener(this) - , ISupport::EventListener(this) - , cmd(this) - , api(this, cmd.extInfo) - , myumode(this, "callerid", 'g') + , CTCTags::EventListener(weak_from_this()) + , ISupport::EventListener(weak_from_this()) + , cmd(weak_from_this()) + , api(weak_from_this(), cmd.extInfo) + , myumode(weak_from_this(), "callerid", 'g') { } @@ -472,7 +472,7 @@ public: void Prioritize() override { // Want to be after modules like account or silence - ServerInstance->Modules.SetPriority(this, I_OnUserPreMessage, PRIORITY_LAST); + ServerInstance->Modules.SetPriority(shared_from_this(), I_OnUserPreMessage, PRIORITY_LAST); } }; -- cgit v1.3.1-10-gc9f91