diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:30:25 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-13 20:30:25 +0000 |
commit | 6d57bbe05c31c79eaad02fe81cfb9c1ed6b79c58 (patch) | |
tree | e0c89ed36b00f4c2925d7f39c32a835657b0fa6e /src/modules/m_ident.cpp | |
parent | 7eea21b8d43b0d5993e88b62d9d4894c2af49303 (diff) |
Change Extensible to use strongly typed entries
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11696 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_ident.cpp')
-rw-r--r-- | src/modules/m_ident.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index 690d7b15c..e5c8940ec 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -280,11 +280,11 @@ class IdentRequestSocket : public EventHandler class ModuleIdent : public Module { - private: int RequestTimeout; ConfigReader *Conf; + SimpleExtItem<IdentRequestSocket> ext; public: - ModuleIdent(InspIRCd *Me) : Module(Me) + ModuleIdent(InspIRCd *Me) : Module(Me), ext("ident_socket", this) { Conf = new ConfigReader(ServerInstance); OnRehash(NULL); @@ -338,7 +338,7 @@ class ModuleIdent : public Module try { IdentRequestSocket *isock = new IdentRequestSocket(ServerInstance, user); - user->Extend("ident_socket", isock); + ext.set(user, isock); } catch (ModuleException &e) { @@ -355,8 +355,8 @@ class ModuleIdent : public Module virtual ModResult OnCheckReady(User *user) { /* Does user have an ident socket attached at all? */ - IdentRequestSocket *isock = NULL; - if (!user->GetExt("ident_socket", isock)) + IdentRequestSocket *isock = ext.get(user); + if (!isock) { ServerInstance->Logs->Log("m_ident",DEBUG, "No ident socket :("); return MOD_RES_PASSTHRU; @@ -413,12 +413,11 @@ class ModuleIdent : public Module virtual void OnUserDisconnect(User *user) { /* User disconnect (generic socket detatch event) */ - IdentRequestSocket *isock = NULL; - if (user->GetExt("ident_socket", isock)) + IdentRequestSocket *isock = ext.get(user); + if (isock) { isock->Close(); - delete isock; - user->Shrink("ident_socket"); + ext.unset(user); } } }; |