]> jfr.im git - irc/quakenet/newserv.git/blobdiff - nick/nick.c
a4stats: Fix two cases where the DB result was not cleaned up properly.
[irc/quakenet/newserv.git] / nick / nick.c
index b08e854a732fd00dab86719bb33a11be453c3238..b95d597cd826fc1207f13c2e976d06ad1fc78eca 100644 (file)
@@ -51,7 +51,7 @@ const flag accountflags[] = {
    { 'd', AFLAG_DEVELOPER },
    { '\0', 0 } };
 
-#define nickhash(x)       ((crc32i(x))%NICKHASHSIZE)
+#define nickhash(x)       ((irc_crc32i(x))%NICKHASHSIZE)
 
 nick *nicktable[NICKHASHSIZE];
 nick **servernicks[MAXSERVERS];
@@ -175,6 +175,9 @@ void handleserverchange(int hooknum, void *arg) {
 void deletenick(nick *np) {
   nick **nh;
 
+  /* Fire a pre-lostnick trigger to allow hooks to check the channels etc. of a lost nick */
+  triggerhook(HOOK_NICK_PRE_LOSTNICK, np);
+
   /* Fire the hook.  This will deal with removal from channels etc. */
   triggerhook(HOOK_NICK_LOSTNICK, np);
   
@@ -218,6 +221,7 @@ void deletenick(nick *np) {
   freesstring(np->shident); /* freesstring(NULL) is OK */
   freesstring(np->sethost); 
   freesstring(np->opername); 
+  freesstring(np->message);
 
   node_decrement_usercount(np->ipnode);
   derefnode(iptree, np->ipnode);