diff options
Diffstat (limited to 'src/modules/m_sasl.cpp')
-rw-r--r-- | src/modules/m_sasl.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 4d1dbbc71..7570e7732 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -26,6 +26,8 @@ class SASLCap : public Cap::Capability { + std::string mechlist; + bool OnRequest(LocalUser* user, bool adding) CXX11_OVERRIDE { // Requesting this cap is allowed anytime @@ -36,11 +38,25 @@ class SASLCap : public Cap::Capability return (user->registered != REG_ALL); } + const std::string* GetValue(LocalUser* user) const CXX11_OVERRIDE + { + return &mechlist; + } + public: SASLCap(Module* mod) : Cap::Capability(mod, "sasl") { } + + void SetMechlist(const std::string& newmechlist) + { + if (mechlist == newmechlist) + return; + + mechlist = newmechlist; + NotifyValueChange(); + } }; enum SaslState { SASL_INIT, SASL_COMM, SASL_DONE }; @@ -305,6 +321,12 @@ class ModuleSASL : public Module return MOD_RES_PASSTHRU; } + void OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string& extdata) CXX11_OVERRIDE + { + if ((target == NULL) && (extname == "saslmechlist")) + cap.SetMechlist(extdata); + } + Version GetVersion() CXX11_OVERRIDE { return Version("Provides support for IRC Authentication Layer (aka: SASL) via AUTHENTICATE.", VF_VENDOR); |