static std::string sasl_target;
-class ServerTracker : public ServerEventListener
+class ServerTracker
+ : public ServerProtocol::LinkEventListener
{
bool online;
Update(server, true);
}
- void OnServerSplit(const Server* server) CXX11_OVERRIDE
+ void OnServerSplit(const Server* server, bool error) CXX11_OVERRIDE
{
Update(server, false);
}
public:
ServerTracker(Module* mod)
- : ServerEventListener(mod)
+ : ServerProtocol::LinkEventListener(mod)
{
Reset();
}
bool OnRequest(LocalUser* user, bool adding) CXX11_OVERRIDE
{
- // Requesting this cap is allowed anytime
- if (adding)
- return true;
-
- // But removing it can only be done when unregistered
- return (user->registered != REG_ALL);
+ // Servers MUST NAK any sasl capability request if the authentication layer
+ // is unavailable.
+ return servertracker.IsOnline();
}
bool OnList(LocalUser* user) CXX11_OVERRIDE
{
+ // Servers MUST NOT advertise the sasl capability if the authentication layer
+ // is unavailable.
return servertracker.IsOnline();
}
case SASL_OK:
this->user->WriteNumeric(RPL_SASLSUCCESS, "SASL authentication successful");
break;
- case SASL_ABORT:
+ case SASL_ABORT:
this->user->WriteNumeric(ERR_SASLABORTED, "SASL authentication aborted");
break;
case SASL_FAIL:
Version GetVersion() CXX11_OVERRIDE
{
- return Version("Provides support for IRC Authentication Layer (aka: SASL) via AUTHENTICATE.", VF_VENDOR);
+ return Version("Provides support for IRC Authentication Layer (aka: SASL) via AUTHENTICATE", VF_VENDOR);
}
};