summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_sasl.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index c9586bf97..ad24fa0d8 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -195,8 +195,8 @@ class ModuleSASL : public Module
ModuleSASL(InspIRCd* Me)
: Module(Me)
{
- Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnPostConnect };
- ServerInstance->Modules->Attach(eventlist, this, 3);
+ Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnPostConnect, I_OnUserDisconnect, I_OnCleanup };
+ ServerInstance->Modules->Attach(eventlist, this, 5);
sasl = new CommandAuthenticate(ServerInstance, this);
ServerInstance->AddCommand(sasl);
@@ -218,6 +218,22 @@ class ModuleSASL : public Module
return 0;
}
+ virtual void OnCleanup(int target_type, void *item)
+ {
+ if (target_type == TYPE_USER)
+ OnUserDisconnect((User*)item);
+ }
+
+ virtual void OnUserDisconnect(User *user)
+ {
+ SaslAuthenticator *sasl_;
+ if (user->GetExt("sasl_authenticator", sasl_))
+ {
+ delete sasl_;
+ user->Shrink("sasl_authenticator");
+ }
+ }
+
virtual void OnPostConnect(User* user)
{
if (!IS_LOCAL(user))