diff options
| author | 2026-03-28 21:32:23 +0000 | |
|---|---|---|
| committer | 2026-03-29 00:42:15 +0000 | |
| commit | cbc5431d62e3fe9166f18395dce3ddf2af0906d3 (patch) | |
| tree | 48a87fc27dc4826ce0caf4071e2060a9ff9e24c5 /modules/gateway.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/gateway.cpp')
| -rw-r--r-- | modules/gateway.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/gateway.cpp b/modules/gateway.cpp index 3bb41f1ae..5f3f17009 100644 --- a/modules/gateway.cpp +++ b/modules/gateway.cpp @@ -148,7 +148,7 @@ class CommandHexIP final private: IRCv3::ReplyCapReference stdrplcap; public: - CommandHexIP(Module* Creator) + CommandHexIP(const WeakModulePtr& Creator) : SplitCommand(Creator, "HEXIP", 1) , stdrplcap(Creator) { @@ -237,7 +237,7 @@ class GatewayExtBan final public: StringExtItem gateway; - GatewayExtBan(Module* Creator) + GatewayExtBan(const WeakModulePtr& Creator) : ExtBan::MatchingBase(Creator, "gateway", 'w') , gateway(Creator, "webirc-gateway", ExtensionType::USER, true) { @@ -261,7 +261,7 @@ public: UserCertificateAPI sslapi; Events::ModuleEventProvider webircevprov; - CommandWebIRC(Module* Creator) + CommandWebIRC(const WeakModulePtr& Creator) : SplitCommand(Creator, "WEBIRC", 4) , extban(Creator) , realhost(Creator, "gateway-realhost", ExtensionType::USER, true) @@ -362,10 +362,10 @@ private: public: ModuleGateway() : Module(VF_VENDOR, "Adds the ability for IRC gateways to forward the real IP address of users connecting through them.") - , WebIRC::EventListener(this) - , Whois::EventListener(this) - , cmdhexip(this) - , cmdwebirc(this) + , WebIRC::EventListener(weak_from_this()) + , Whois::EventListener(weak_from_this()) + , cmdhexip(weak_from_this()) + , cmdwebirc(weak_from_this()) { } @@ -388,7 +388,7 @@ public: // Ensure that we have the <gateway:mask> parameter. if (masks.empty()) - throw ModuleException(this, "<" + tag->name + ":mask> is a mandatory field, at " + tag->source.str()); + throw ModuleException(weak_from_this(), "<" + tag->name + ":mask> is a mandatory field, at " + tag->source.str()); // Determine what lookup type this host uses. const std::string type = tag->getString("type"); @@ -408,7 +408,7 @@ public: // WebIRC blocks require a password. if (fingerprint.empty() && password.empty()) - throw ModuleException(this, "When using <" + tag->name + " type=\"webirc\"> either the fingerprint or password field is required, at " + tag->source.str()); + throw ModuleException(weak_from_this(), "When using <" + tag->name + " type=\"webirc\"> either the fingerprint or password field is required, at " + tag->source.str()); if (!password.empty() && insp::equalsci(passwordhash, "plaintext")) { @@ -420,7 +420,7 @@ public: } else { - throw ModuleException(this, type + " is an invalid <" + tag->name + ":mask> type, at " + tag->source.str()); + throw ModuleException(weak_from_this(), type + " is an invalid <" + tag->name + ":mask> type, at " + tag->source.str()); } } |
