1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 22:43:13 +02:00

Move SASL protocol messages to the SASL header.

This commit is contained in:
Sadie Powell
2025-03-03 21:45:59 +00:00
parent 4526fbed96
commit 5828cdba45
7 changed files with 54 additions and 13 deletions
+5 -1
View File
@@ -101,6 +101,7 @@ namespace
class InspIRCdProto final
: public IRCDProto
, public SASL::ProtocolInterface
{
private:
static Anope::string GetAccountNicks(NickAlias* na)
@@ -155,7 +156,10 @@ private:
public:
PrimitiveExtensibleItem<ListLimits> maxlist;
InspIRCdProto(Module *creator) : IRCDProto(creator, "InspIRCd 3+"), maxlist(creator, "maxlist")
InspIRCdProto(Module *creator)
: IRCDProto(creator, "InspIRCd 3+")
, SASL::ProtocolInterface(creator)
, maxlist(creator, "maxlist")
{
DefaultPseudoclientModes = "+oI";
CanSVSNick = true;
+4 -1
View File
@@ -18,9 +18,12 @@ static ServiceReference<IRCDProto> hybrid("IRCDProto", "hybrid");
class PlexusProto final
: public IRCDProto
, SASL::ProtocolInterface
{
public:
PlexusProto(Module *creator) : IRCDProto(creator, "hybrid-7.2.3+plexus-3.0.1")
PlexusProto(Module *creator)
: IRCDProto(creator, "hybrid-7.2.3+plexus-3.0.1")
, SASL::ProtocolInterface(creator)
{
DefaultPseudoclientModes = "+iU";
CanSVSNick = true;
+4 -2
View File
@@ -32,10 +32,12 @@ public:
class SolanumProto final
: public IRCDProto
, public SASL::ProtocolInterface
{
public:
SolanumProto(Module *creator) : IRCDProto(creator, "Solanum")
SolanumProto(Module *creator)
: IRCDProto(creator, "Solanum")
, SASL::ProtocolInterface(creator)
{
DefaultPseudoclientModes = "+oiS";
CanCertFP = true;
+2
View File
@@ -36,6 +36,7 @@ namespace
class UnrealIRCdProto final
: public IRCDProto
, public SASL::ProtocolInterface
{
public:
PrimitiveExtensibleItem<ModData> ClientModData;
@@ -43,6 +44,7 @@ public:
UnrealIRCdProto(Module *creator)
: IRCDProto(creator, "UnrealIRCd 6+")
, SASL::ProtocolInterface(creator)
, ClientModData(creator, "ClientModData")
, ChannelModData(creator, "ChannelModData")
{
+9 -5
View File
@@ -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);
}
};