aboutsummaryrefslogtreecommitdiffstats
path: root/modules/services.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-03-25 12:22:59 +0000
committerGravatar Sadie Powell2026-03-25 12:22:59 +0000
commita837d0c46b018c4e66ef9b4f85544a411346ba1d (patch)
tree3b5b34e32a052f9bbf981a473efe90d7b01db8d5 /modules/services.cpp
parentMerge branch 'insp4' into master. (diff)
Use server tracking from the services module in the sasl module.
Diffstat (limited to 'modules/services.cpp')
-rw-r--r--modules/services.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/services.cpp b/modules/services.cpp
index 9e296a0c0..a98393a4a 100644
--- a/modules/services.cpp
+++ b/modules/services.cpp
@@ -45,6 +45,7 @@ class ServicesAccountProvider final
{
private:
std::string target;
+ const Server* targetserver = nullptr;
void OnServerLink(const Server& server) override
{
@@ -71,6 +72,7 @@ private:
{
ServerInstance->Logs.Debug(MODNAME, "Services server {} ({}) {}.", server.GetName(),
server.GetId(), online ? "came online" : "went offline");
+ targetserver = online ? &server : nullptr;
SetAvailable(online);
}
}
@@ -82,6 +84,11 @@ public:
{
}
+ const Server* GetServer() const override
+ {
+ return targetserver;
+ }
+
void SetTarget(const std::string& newtarget)
{
if (target == newtarget)
@@ -600,7 +607,7 @@ class ModuleServices final
{
private:
Account::API accountapi;
- ServicesAccountProvider accountprovapi;
+ ServicesAccountProvider accountproviderapi;
RegisteredChannel registeredcmode;
RegisteredUser registeredumode;
ServiceTag servicetag;
@@ -662,7 +669,7 @@ public:
, ServerProtocol::RouteEventListener(this)
, Stats::EventListener(this)
, accountapi(this)
- , accountprovapi(this)
+ , accountproviderapi(this)
, registeredcmode(this)
, registeredumode(this)
, servicetag(this)
@@ -699,7 +706,7 @@ public:
if (target.empty())
throw ModuleException(this, "<servicesintegration:server> must be set to the name of your services server!");
- accountprovapi.SetTarget(target);
+ accountproviderapi.SetTarget(target);
accountoverrideshold = tag->getBool("accountoverrideshold");
}