diff options
author | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-27 17:52:08 +0000 |
---|---|---|
committer | om <om@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-01-27 17:52:08 +0000 |
commit | 74c6e4d21cb2566be749db330679fe34376ef69a (patch) | |
tree | f92e12b360bdd2a0596c5bdbaf3b287f8e609cae /src/modules | |
parent | 330a057983a9ea7496010d32d7216b1c4c4b2181 (diff) |
Add OnCleanup (every little helps! :p)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2941 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_conn_waitpong.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 245182536..a32487f58 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -62,7 +62,7 @@ class ModuleWaitPong : public Module void Implements(char* List) { - List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnPreCommand] = List[I_OnRehash] = List[I_OnUserDisconnect] = 1; + List[I_OnUserRegister] = List[I_OnCheckReady] = List[I_OnPreCommand] = List[I_OnRehash] = List[I_OnUserDisconnect] = List[I_OnCleanup] = 1; } virtual void OnUserRegister(userrec* user) @@ -116,6 +116,21 @@ class ModuleWaitPong : public Module } } + virtual void OnCleanup(int target_type, void* item) + { + if(target_type == TYPE_USER) + { + userrec* user = (userrec*)item; + std::string* pingrpl = (std::string*)user->GetExt("waitpong_pingstr"); + + if(pingrpl) + { + delete pingrpl; + user->Shrink("waitpong_pingstr"); + } + } + } + virtual ~ModuleWaitPong() { } |