aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sethost.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/sethost.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/sethost.cpp')
-rw-r--r--modules/sethost.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/sethost.cpp b/modules/sethost.cpp
index 278410351..9e1e26784 100644
--- a/modules/sethost.cpp
+++ b/modules/sethost.cpp
@@ -33,7 +33,7 @@ public:
IRCv3::ReplyCapReference cap;
CharState hostmap;
- CommandSetHost(Module* mod)
+ CommandSetHost(const WeakModulePtr& mod)
: Command(mod, "SETHOST", 1, 2)
, cap(mod)
{
@@ -113,7 +113,7 @@ private:
public:
ModuleSetHost()
: Module(VF_VENDOR | VF_OPTCOMMON, "Adds the /SETHOST command which allows server operators to change the hostname of users.")
- , cmd(this)
+ , cmd(weak_from_this())
{
}
@@ -126,7 +126,7 @@ public:
{
// A hostname can not contain NUL, LF, CR, or SPACE.
if (chr == 0x00 || chr == 0x0A || chr == 0x0D || chr == 0x20)
- throw ModuleException(this, "<hostname:charmap> can not contain character 0x{:02X} ({})", chr, chr);
+ throw ModuleException(weak_from_this(), "<hostname:charmap> can not contain character 0x{:02X} ({})", chr, chr);
newhostmap.set(static_cast<unsigned char>(chr));
}
std::swap(newhostmap, cmd.hostmap);