1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 05:06:37 +02:00

Misc cleanup of ns_sasl and sasl.h.

This commit is contained in:
Sadie Powell
2025-03-03 23:54:03 +00:00
parent c0c7046a6d
commit 34896cefe9
6 changed files with 73 additions and 63 deletions
+11 -11
View File
@@ -42,7 +42,7 @@ namespace SASL
virtual void RemoveSession(Session *) = 0;
};
static ServiceReference<SASL::Service> sasl("SASL::Service", "sasl");
static ServiceReference<SASL::Service> service("SASL::Service", "sasl");
struct Session
{
@@ -65,8 +65,8 @@ namespace SASL
virtual ~Session()
{
if (sasl)
sasl->RemoveSession(this);
if (service)
service->RemoveSession(this);
}
};
@@ -83,8 +83,8 @@ namespace SASL
virtual ~Mechanism()
{
if (sasl)
sasl->DeleteSessions(this, true);
if (service)
service->DeleteSessions(this, true);
}
};
@@ -114,7 +114,7 @@ namespace SASL
void OnSuccess() override
{
if (!sasl)
if (!service)
return;
NickAlias *na = NickAlias::Find(GetAccount());
@@ -125,24 +125,24 @@ namespace SASL
if (maxlogins && na->nc->users.size() >= maxlogins)
return OnFail();
Session *s = sasl->GetSession(uid);
Session *s = service->GetSession(uid);
if (s)
{
Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << GetUserInfo() << " identified to account " << this->GetAccount() << " using SASL";
sasl->Succeed(s, na->nc);
service->Succeed(s, na->nc);
delete s;
}
}
void OnFail() override
{
if (!sasl)
if (!service)
return;
Session *s = sasl->GetSession(uid);
Session *s = service->GetSession(uid);
if (s)
{
sasl->Fail(s);
service->Fail(s);
delete s;
}