aboutsummaryrefslogtreecommitdiffstats
path: root/modules/disable.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-28 21:32:23 +0000
committerGravatar Sadie Powell2026-03-29 00:42:15 +0000
commitcbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch)
tree48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/disable.cpp
parentMove service code from base to its own header. (diff)
downloadinspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.tar.gz
inspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.tar.bz2
inspircd++-cbc5431d62e3fe9166f18395dce3ddf2af0906d3.zip
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/disable.cpp')
-rw-r--r--modules/disable.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/disable.cpp b/modules/disable.cpp
index 639d068dc..ebed6bb75 100644
--- a/modules/disable.cpp
+++ b/modules/disable.cpp
@@ -51,13 +51,13 @@ private:
{
// Check that the character is a valid mode letter.
if (!ModeParser::IsModeChar(chr))
- throw ModuleException(this, "Invalid mode '{}' was specified in <disabled:{}> at {}",
+ throw ModuleException(weak_from_this(), "Invalid mode '{}' was specified in <disabled:{}> at {}",
chr, field, tag->source.str());
// Check that the mode actually exists.
ModeHandler* mh = ServerInstance->Modes.FindMode(chr, type);
if (!mh)
- throw ModuleException(this, FMT::format("Nonexistent mode '{}' was specified in <disabled:{}> at {}",
+ throw ModuleException(weak_from_this(), FMT::format("Nonexistent mode '{}' was specified in <disabled:{}> at {}",
chr, field, tag->source.str()));
// Disable the mode.
@@ -79,7 +79,7 @@ private:
public:
ModuleDisable()
: Module(VF_VENDOR, "Allows commands, channel modes, and user modes to be disabled.")
- , ISupport::EventListener(this)
+ , ISupport::EventListener(weak_from_this())
{
}
@@ -95,7 +95,7 @@ public:
// Check that the command actually exists.
Command* handler = ServerInstance->Parser.GetHandler(command);
if (!handler)
- throw ModuleException(this, "Nonexistent command '{}' was specified in <disabled:commands> at {}",
+ throw ModuleException(weak_from_this(), "Nonexistent command '{}' was specified in <disabled:commands> at {}",
command, tag->source.str());
// Prevent admins from disabling MODULES for transparency reasons.