From d94c99d4ffad183e6a064d68568dda46b9293b44 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 21 Mar 2008 21:03:39 +0000 Subject: That stuff belongs in OnPostconnect or it will be sent too early git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9160 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sasl.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 278058190..1758c7771 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -59,8 +59,8 @@ class ModuleSASL : public Module ModuleSASL(InspIRCd* Me) : Module(Me) { - Implementation eventlist[] = { I_OnEvent, I_OnUserRegister }; - ServerInstance->Modules->Attach(eventlist, this, 2); + Implementation eventlist[] = { I_OnEvent, I_OnUserRegister, I_OnPostConnect }; + ServerInstance->Modules->Attach(eventlist, this, 3); sasl = new CommandAuthenticate(ServerInstance, this); ServerInstance->AddCommand(sasl); @@ -71,14 +71,22 @@ class ModuleSASL : public Module virtual int OnUserRegister(User *user) { - std::string* str = NULL; - if (user->GetExt("sasl")) { user->WriteServ("906 %s :SASL authentication aborted", user->nick); user->Shrink("sasl"); } + return 0; + } + + virtual void OnPostConnect(User* user) + { + if (!IS_LOCAL(user)) + return; + + std::string* str = NULL; + if (user->GetExt("acountname", str)) { std::deque params; @@ -88,7 +96,7 @@ class ModuleSASL : public Module Event e((char*)¶ms, this, "send_metadata"); e.Send(ServerInstance); } - return 0; + return; } virtual ~ModuleSASL() -- cgit v1.2.3