diff options
author | Adam <Adam@anope.org> | 2014-05-28 12:07:29 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-05-28 12:07:54 -0400 |
commit | f29e1cf383529a1a29f02b0669d973f5ee0b7a66 (patch) | |
tree | 3c33db276dc9328235bbd572641521ed44458176 /include/modules/sasl.h | |
parent | 1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (diff) |
Move most of the core pseudoclient logic to modules
Diffstat (limited to 'include/modules/sasl.h')
-rw-r--r-- | include/modules/sasl.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/include/modules/sasl.h b/include/modules/sasl.h index dbe6441e9..28bdb1ca6 100644 --- a/include/modules/sasl.h +++ b/include/modules/sasl.h @@ -33,7 +33,7 @@ namespace SASL virtual void SendMessage(SASL::Session *session, const Anope::string &type, const Anope::string &data) = 0; - virtual void Succeed(Session *, NickCore *) = 0; + virtual void Succeed(Session *, NickServ::Account *) = 0; virtual void Fail(Session *) = 0; virtual void SendMechs(Session *) = 0; virtual void DeleteSessions(Mechanism *, bool = false) = 0; @@ -73,32 +73,32 @@ namespace SASL } }; - class IdentifyRequest : public ::IdentifyRequest + class IdentifyRequestListener : public NickServ::IdentifyRequestListener { Anope::string uid; public: - IdentifyRequest(Module *m, const Anope::string &id, const Anope::string &acc, const Anope::string &pass) : ::IdentifyRequest(m, acc, pass), uid(id) { } + IdentifyRequestListener(const Anope::string &id) : uid(id) { } - void OnSuccess() override + void OnSuccess(NickServ::IdentifyRequest *req) override { if (!sasl) return; - NickAlias *na = NickAlias::Find(GetAccount()); + NickServ::Nick *na = NickServ::FindNick(req->GetAccount()); if (!na || na->nc->HasExt("NS_SUSPENDED")) - return OnFail(); + return OnFail(req); Session *s = sasl->GetSession(uid); if (s) { - Log(Config->GetClient("NickServ")) << "A user identified to account " << this->GetAccount() << " using SASL"; + Log(Config->GetClient("NickServ")) << "A user identified to account " << req->GetAccount() << " using SASL"; sasl->Succeed(s, na->nc); delete s; } } - void OnFail() override + void OnFail(NickServ::IdentifyRequest *req) override { if (!sasl) return; @@ -111,13 +111,13 @@ namespace SASL } Anope::string accountstatus; - NickAlias *na = NickAlias::Find(GetAccount()); + NickServ::Nick *na = NickServ::FindNick(req->GetAccount()); if (!na) accountstatus = "nonexistent "; else if (na->nc->HasExt("NS_SUSPENDED")) accountstatus = "suspended "; - Log(Config->GetClient("NickServ")) << "A user failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL"; + Log(Config->GetClient("NickServ")) << "A user failed to identify for " << accountstatus << "account " << req->GetAccount() << " using SASL"; } }; } |