summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-27 18:42:15 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2006-01-27 18:42:15 +0000
commitea0332da6db199bb88dd7173d76644de444a8fcd (patch)
treee020d3a0562dcd38f9ad4f8469ba7bed09edb8e5
parent82eefb5091f8d2315bbe8179233279e87b03a04d (diff)
Yet more tasty OnCleanup :)~~~
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2945 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_nicklock.cpp18
1 files changed, 13 insertions, 5 deletions
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.