]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_sasl.cpp
m_chanfilter: Apply filters to part messages (#1702)
[user/henk/code/inspircd.git] / src / modules / m_sasl.cpp
index 0fb277b2363d514744028669640570028c826f10..28bce2bf3c44478fe5cbde604d66847bbf1afc72 100644 (file)
@@ -104,16 +104,15 @@ class SASLCap : public Cap::Capability
 
        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();
        }