summaryrefslogtreecommitdiff
path: root/src/modules/m_sasl.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-08-13 20:17:46 +0100
committerPeter Powell <petpow@saberuk.com>2018-08-13 21:51:11 +0100
commit58a0a7e01422e62de1565a8eb0a1febdc463d04d (patch)
tree8861789deefe9df3524690de8ccd11e5366f1f2e /src/modules/m_sasl.cpp
parente2a820cce21342478653a34cf8ce2b593128d035 (diff)
Implement IRCv3 message tag support.
Co-authored-by: Attila Molnar <attilamolnar@hush.com>
Diffstat (limited to 'src/modules/m_sasl.cpp')
-rw-r--r--src/modules/m_sasl.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index d37e1c90f..480f8f6db 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -145,7 +145,7 @@ static Events::ModuleEventProvider* saslevprov;
static void SendSASL(LocalUser* user, const std::string& agent, char mode, const std::vector<std::string>& parameters)
{
- CommandBase::Params params(parameters.size() + 3);
+ CommandBase::Params params;
params.push_back(user->uuid);
params.push_back(agent);
params.push_back(ConvToStr(mode));
@@ -157,6 +157,8 @@ static void SendSASL(LocalUser* user, const std::string& agent, char mode, const
}
}
+static ClientProtocol::EventProvider* g_protoev;
+
/**
* Tracks SASL authentication state like charybdis does. --nenolod
*/
@@ -223,7 +225,15 @@ class SaslAuthenticator
return this->state;
if (msg[2] == "C")
- this->user->Write("AUTHENTICATE %s", msg[3].c_str());
+ {
+ ClientProtocol::Message authmsg("AUTHENTICATE");
+ authmsg.PushParamRef(msg[3]);
+
+ ClientProtocol::Event authevent(*g_protoev, authmsg);
+ LocalUser* const localuser = IS_LOCAL(user);
+ if (localuser)
+ localuser->Send(authevent);
+ }
else if (msg[2] == "D")
{
this->state = SASL_DONE;
@@ -377,6 +387,7 @@ class ModuleSASL : public Module
CommandAuthenticate auth;
CommandSASL sasl;
Events::ModuleEventProvider sasleventprov;
+ ClientProtocol::EventProvider protoev;
public:
ModuleSASL()
@@ -386,8 +397,10 @@ class ModuleSASL : public Module
, auth(this, authExt, cap)
, sasl(this, authExt)
, sasleventprov(this, "event/sasl")
+ , protoev(this, auth.name)
{
saslevprov = &sasleventprov;
+ g_protoev = &protoev;
}
void init() CXX11_OVERRIDE