summaryrefslogtreecommitdiff
path: root/include/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-03 21:45:59 +0000
committerSadie Powell <sadie@witchery.services>2025-03-03 21:45:59 +0000
commit5828cdba45bbcf27349c62f13d341d31fcf01853 (patch)
tree264cef2cd928b9c0ce60627a75f1668598118a2d /include/modules
parent4526fbed960085e3996fcd70195887f462c430d8 (diff)
Move SASL protocol messages to the SASL header.
Diffstat (limited to 'include/modules')
-rw-r--r--include/modules/sasl.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/modules/sasl.h b/include/modules/sasl.h
index 5f8d0e9c3..2bed96cbd 100644
--- a/include/modules/sasl.h
+++ b/include/modules/sasl.h
@@ -158,4 +158,34 @@ namespace SASL
Log(this->GetOwner(), "sasl", Config->GetClient("NickServ")) << GetUserInfo() << " failed to identify for " << accountstatus << "account " << this->GetAccount() << " using SASL";
}
};
+
+ /** Sends IRCd messages used by the SASL module. */
+ class CoreExport ProtocolInterface
+ : public ::Service
+ {
+ protected:
+ ProtocolInterface(Module *o)
+ : ::Service(o, "SASL::ProtocolInterface", "sasl")
+ {
+ }
+
+ public:
+ /** Sends the list of SASL mechanisms to the IRCd
+ * @param mechs The list of SASL mechanisms.
+ */
+ virtual void SendSASLMechanisms(std::vector<Anope::string> &mechs) { };
+
+ /** Sends a SASL message to the IRCd.
+ * @param message The SASL message to send.
+ */
+ virtual void SendSASLMessage(const SASL::Message &message) = 0;
+
+ /** Sends a login or logout for \p uid to \p na.
+ * @param uid The uid of the user to log in.
+ * @param na The nick alias to log the user in as or logout if nullptr.
+ */
+ virtual void SendSVSLogin(const Anope::string &uid, NickAlias *na) = 0;
+ };
+
+ static ServiceReference<SASL::ProtocolInterface> protocol_interface("SASL::ProtocolInterface", "sasl");
}