diff options
| author | 2026-03-27 13:10:26 +0000 | |
|---|---|---|
| committer | 2026-03-27 13:10:26 +0000 | |
| commit | cbdcd051c63c4ff98dfb4ff45388e722f8d0a2de (patch) | |
| tree | f2c61a977edce634fc28b9dead3d8bfa5782211c /include/modules | |
| parent | Move CUList to be declared inside User. (diff) | |
Switch the extensible system to using shared pointers.
Diffstat (limited to 'include/modules')
| -rw-r--r-- | include/modules/cap.h | 4 | ||||
| -rw-r--r-- | include/modules/geolocation.h | 7 | ||||
| -rw-r--r-- | include/modules/ssl.h | 9 |
3 files changed, 10 insertions, 10 deletions
diff --git a/include/modules/cap.h b/include/modules/cap.h index 63d5f8c0b..d665f1509 100644 --- a/include/modules/cap.h +++ b/include/modules/cap.h @@ -34,8 +34,8 @@ namespace Cap public: ExtItem(Module* mod); void FromInternal(Extensible* container, const std::string& value) noexcept override; - std::string ToHuman(const Extensible* container, void* item) const noexcept override; - std::string ToInternal(const Extensible* container, void* item) const noexcept override; + std::string ToHuman(const Extensible* container, const ExtensionPtr& item) const noexcept override; + std::string ToInternal(const Extensible* container, const ExtensionPtr& item) const noexcept override; }; class Capability; diff --git a/include/modules/geolocation.h b/include/modules/geolocation.h index b784f6531..fffc8489d 100644 --- a/include/modules/geolocation.h +++ b/include/modules/geolocation.h @@ -24,6 +24,8 @@ namespace Geolocation class APIBase; class API; class Location; + + using LocationPtr = std::shared_ptr<Location>; } class Geolocation::APIBase @@ -39,13 +41,13 @@ public: * @param user The user to look up the location of. * @return Either an instance of the Location class or NULL if no location could be found. */ - virtual Location* GetLocation(User* user) = 0; + virtual LocationPtr GetLocation(User* user) = 0; /** Looks up the location of the specified IP address. * @param sa The IP address to look up the location of. * @return Either an instance of the Location class or NULL if no location could be found. */ - virtual Location* GetLocation(irc::sockets::sockaddrs& sa) = 0; + virtual LocationPtr GetLocation(irc::sockets::sockaddrs& sa) = 0; }; class Geolocation::API final @@ -59,7 +61,6 @@ public: }; class Geolocation::Location final - : public usecountbase { private: /** The two character country code for this location. */ diff --git a/include/modules/ssl.h b/include/modules/ssl.h index 5cff540ea..e1649cc98 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -37,7 +37,6 @@ * connected local users using SSLCertExt */ class ssl_cert final - : public refcountbase { public: std::string dn; @@ -194,7 +193,7 @@ protected: /** Peer TLS certificate, set by the TLS module */ - reference<ssl_cert> certificate; + std::shared_ptr<ssl_cert> certificate; /** The status of the TLS connection. */ Status status = STATUS_NONE; @@ -246,7 +245,7 @@ public: * Get the certificate sent by this peer * @return The TLS certificate sent by the peer, NULL if no cert was sent */ - virtual ssl_cert* GetCertificate() const + virtual const std::shared_ptr<ssl_cert>& GetCertificate() const { return certificate; } @@ -258,7 +257,7 @@ public: */ virtual std::string GetFingerprint() const { - ssl_cert* cert = GetCertificate(); + const auto& cert = GetCertificate(); if (cert && cert->IsUsable()) return cert->GetFingerprint(); return ""; @@ -304,7 +303,7 @@ public: * @param user The user whose certificate to set. * @param cert The TLS certificate to set for the user. */ - virtual void SetCertificate(User* user, ssl_cert* cert) = 0; + virtual void SetCertificate(User* user, const std::shared_ptr<ssl_cert>& cert) = 0; /** Get the primary fingerprint from a user's certificate * @param user The user whose primary fingerprint to get. |
