1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 14:56:38 +02:00

Add the ReplaceCert method to CertService.

This commit is contained in:
Sadie Powell
2024-05-01 21:20:31 +01:00
parent 4cfee23303
commit e9243c3fde
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -79,4 +79,5 @@ public:
CertService(Module *c) : Service(c, "CertService", "certs") { }
virtual NickCore *FindAccountFromCert(const Anope::string &cert) = 0;
virtual void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) = 0;
};
+11
View File
@@ -26,6 +26,17 @@ struct CertServiceImpl final
return it->second;
return NULL;
}
void ReplaceCert(const Anope::string &oldcert, const Anope::string &newcert) override
{
auto *nc = FindAccountFromCert(oldcert);
if (!nc)
return;
auto *cl = nc->GetExt<NSCertList>("certificates");
if (cl)
cl->ReplaceCert(oldcert, newcert);
}
};
struct NSCertListImpl final