aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sethost.cpp
diff options
context:
space:
mode:
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);