diff options
| author | 2026-03-28 21:32:23 +0000 | |
|---|---|---|
| committer | 2026-03-29 00:42:15 +0000 | |
| commit | cbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch) | |
| tree | 48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/callerid.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/callerid.cpp')
| -rw-r--r-- | modules/callerid.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
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); } }; |
