summaryrefslogtreecommitdiff
path: root/src/modules/m_callerid.cpp
diff options
context:
space:
mode:
authoraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-27 00:12:11 +0000
committeraquanight <aquanight@e03df62e-2008-0410-955e-edbf42e46eb7>2008-01-27 00:12:11 +0000
commit20bea3078d67a090ebcca64bf3cdbd7e6ab6adb6 (patch)
tree154357b8fdc476393e110ac48686a1160b508058 /src/modules/m_callerid.cpp
parent5773bcf973708ee2d9b0eca42fd0f8076a93f4c9 (diff)
Change API OnOperCompare to OnPassCompare, password hashing is now available for <connect:allow>, <power die= restart=>, <title> (m_customtitle.so), <vhost> (m_vhost.so), this works the same was as for <oper>: load m_password_hash.so (after all hasher modules, of course), and add hash="md5/sha256/whatever" to the relevant tag. Also fix m_callerid.cpp crashing on unload.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8755 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_callerid.cpp')
-rw-r--r--src/modules/m_callerid.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index 6d7d8413f..d3df1948b 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -222,13 +222,13 @@ public:
delete myumode;
throw new ModuleException("Could not add usermode and command!");
}
- Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage };
- ServerInstance->Modules->Attach(eventlist, this, 6);
+ Implementation eventlist[] = { I_OnRehash, I_OnUserPreNick, I_OnUserQuit, I_On005Numeric, I_OnUserPreNotice, I_OnUserPreMessage, I_OnCleanup };
+ ServerInstance->Modules->Attach(eventlist, this, 7);
}
~ModuleCallerID()
{
- delete mycommand;
+ delete myumode;
}
Version GetVersion()
@@ -279,6 +279,14 @@ public:
return 0;
}
+ void OnCleanup(int type, void* item)
+ {
+ if (type != TYPE_USER) return;
+ User* u = (User*)item;
+ /* Cleanup only happens on unload (before dtor), so keep this O(n) instead of O(n^2) which deferring to OnUserQuit would do. */
+ RemoveData(u);
+ }
+
int OnUserPreNick(User* user, const std::string& newnick)
{
if (!tracknick)