]> jfr.im git - irc/quakenet/newserv.git/blobdiff - nick/nick.c
Merge.
[irc/quakenet/newserv.git] / nick / nick.c
index bc2b3db07bf77a2c2c60e9192fd29c99483ea2bc..c43a87e0294b75454edace7477b0d956544cafa6 100644 (file)
@@ -54,6 +54,8 @@ sstring *nickextnames[MAXNICKEXTS];
 
 void nickstats(int hooknum, void *arg);
 
+char *NULLAUTHNAME = "";
+
 void _init() {
   unsigned int i;
   authname *anp;
@@ -67,6 +69,13 @@ void _init() {
   initnickhelpers();
   memset(nicktable,0,sizeof(nicktable));
   memset(servernicks,0,sizeof(servernicks));
+
+  /* If we're connected to IRC, force a disconnect.  This needs to be done
+   * before we register all our hooks which would otherwise get called
+   * during the disconnect. */
+  if (connected) {
+    irc_send("%s SQ %s 0 :Resync [adding nick support]",mynumeric->content,myserver->content); irc_disconnected();
+  }
   
   /* Register our hooks */
   registerhook(HOOK_SERVER_NEWSERVER,&handleserverchange);
@@ -98,7 +107,7 @@ void _fini() {
       freesstring(np->shident);
       freesstring(np->sethost);
       freesstring(np->opername);
-      if(!np->auth && np->authname)
+      if(!np->auth && np->authname && (np->authname != NULLAUTHNAME))
         free(np->authname);
     }
   }
@@ -183,7 +192,7 @@ void deletenick(nick *np) {
   
   if(IsAccount(np)) {
     if(!np->auth) {
-      if(np->authname)
+      if(np->authname && (np->authname != NULLAUTHNAME))
         free(np->authname);
     } else {
       np->auth->usercount--;