From ea0332da6db199bb88dd7173d76644de444a8fcd Mon Sep 17 00:00:00 2001 From: om Date: Fri, 27 Jan 2006 18:42:15 +0000 Subject: Yet more tasty OnCleanup :)~~~ git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2945 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_nicklock.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index 731704d68..4bdbaa8f0 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -110,7 +110,7 @@ class ModuleNickLock : public Module void Implements(char* List) { - List[I_OnUserPreNick] = List[I_OnUserQuit] = 1; + List[I_OnUserPreNick] = List[I_OnUserQuit] = List[I_OnCleanup] = 1; } virtual int OnUserPreNick(userrec* user, std::string newnick) @@ -123,11 +123,19 @@ class ModuleNickLock : public Module return 0; } - virtual void OnUserQuit(userrec* user, std::string reason) - { - user->Shrink("nick_locked"); - } + virtual void OnUserQuit(userrec* user, std::string reason) + { + user->Shrink("nick_locked"); + } + virtual void OnCleanup(int target_type, void* item) + { + if(target_type == TYPE_USER) + { + userrec* user = (userrec*)item; + user->Shrink("nick_locked"); + } + } }; // stuff down here is the module-factory stuff. For basic modules you can ignore this. -- cgit v1.2.3