diff options
author | Sadie Powell <sadie@witchery.services> | 2025-03-03 21:45:59 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-03-03 21:45:59 +0000 |
commit | 5828cdba45bbcf27349c62f13d341d31fcf01853 (patch) | |
tree | 264cef2cd928b9c0ce60627a75f1668598118a2d /modules/sasl.cpp | |
parent | 4526fbed960085e3996fcd70195887f462c430d8 (diff) |
Move SASL protocol messages to the SASL header.
Diffstat (limited to 'modules/sasl.cpp')
-rw-r--r-- | modules/sasl.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/sasl.cpp b/modules/sasl.cpp index 795a76bf3..bbbdda696 100644 --- a/modules/sasl.cpp +++ b/modules/sasl.cpp @@ -292,7 +292,7 @@ public: msg.type = mtype; msg.data.push_back(data); - IRCD->SendSASLMessage(msg); + protocol_interface->SendSASLMessage(msg); } void Succeed(Session *session, NickCore *nc) override @@ -310,7 +310,7 @@ public: } else { - IRCD->SendSVSLogin(session->uid, na); + protocol_interface->SendSVSLogin(session->uid, na); } this->SendMessage(session, "D", "S"); } @@ -397,20 +397,23 @@ class ModuleSASL final void CheckMechs() { std::vector<Anope::string> newmechs = ::Service::GetServiceKeys("SASL::Mechanism"); - if (newmechs == mechs) + if (newmechs == mechs || !protocol_interface) return; mechs = newmechs; // If we are connected to the network then broadcast the mechlist. if (Me && Me->IsSynced()) - IRCD->SendSASLMechanisms(mechs); + protocol_interface->SendSASLMechanisms(mechs); } public: ModuleSASL(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), sasl(this), anonymous(this), plain(this) { + if (!protocol_interface) + throw ModuleException("Your IRCd does not support SASL"); + try { external = new External(this); @@ -437,7 +440,8 @@ public: void OnPreUplinkSync(Server *) override { // We have not yet sent a mechanism list so always do it here. - IRCD->SendSASLMechanisms(mechs); + if (!protocol_interface) + protocol_interface->SendSASLMechanisms(mechs); } }; |