aboutsummaryrefslogtreecommitdiffstats
path: root/modules/nicklock.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/nicklock.cpp
parentMove service code from base to its own header. (diff)
Switch modules from reference<> to shared_ptr<> and weak_ptr<>.
Diffstat (limited to 'modules/nicklock.cpp')
-rw-r--r--modules/nicklock.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/nicklock.cpp b/modules/nicklock.cpp
index 4f25dd16c..103d2c7e8 100644
--- a/modules/nicklock.cpp
+++ b/modules/nicklock.cpp
@@ -40,7 +40,7 @@ class CommandNicklock final
{
public:
BoolExtItem& locked;
- CommandNicklock (Module* Creator, BoolExtItem& ext)
+ CommandNicklock(const WeakModulePtr& Creator, BoolExtItem& ext)
: Command(Creator, "NICKLOCK", 2)
, locked(ext)
{
@@ -99,7 +99,7 @@ class CommandNickunlock final
{
public:
BoolExtItem& locked;
- CommandNickunlock (Module* Creator, BoolExtItem& ext)
+ CommandNickunlock(const WeakModulePtr& Creator, BoolExtItem& ext)
: Command(Creator, "NICKUNLOCK", 1)
, locked(ext)
{
@@ -153,9 +153,9 @@ private:
public:
ModuleNickLock()
: Module(VF_VENDOR | VF_OPTCOMMON, "Adds the /NICKLOCK command which allows server operators to change a user's nickname and prevent them from changing it again until they disconnect.")
- , locked(this, "nick-locked", ExtensionType::USER)
- , cmd1(this, locked)
- , cmd2(this, locked)
+ , locked(weak_from_this(), "nick-locked", ExtensionType::USER)
+ , cmd1(weak_from_this(), locked)
+ , cmd2(weak_from_this(), locked)
{
}
@@ -171,7 +171,7 @@ public:
void Prioritize() override
{
- ServerInstance->Modules.SetPriority(this, I_OnUserPreNick, PRIORITY_BEFORE, "nickflood");
+ ServerInstance->Modules.SetPriority(shared_from_this(), I_OnUserPreNick, PRIORITY_BEFORE, "nickflood");
}
};