]> jfr.im git - irc/quakenet/newserv.git/blobdiff - nick/nick.c
Various changes to support authname being stored inside the authext.
[irc/quakenet/newserv.git] / nick / nick.c
index 958ec6f31f80e845866586485e964c6b831d773f..bc2b3db07bf77a2c2c60e9192fd29c99483ea2bc 100644 (file)
@@ -38,7 +38,10 @@ const flag umodeflags[] = {
    { '\0', 0 } };
 
 const flag accountflags[] = {
-   { 's', AFLAG_STAFF },
+   { 'q', AFLAG_STAFF },
+   { 'h', AFLAG_SUPPORT },
+   { 'o', AFLAG_OPER },
+   { 'a', AFLAG_ADMIN },
    { 'd', AFLAG_DEVELOPER },
    { '\0', 0 } };
 
@@ -95,6 +98,8 @@ void _fini() {
       freesstring(np->shident);
       freesstring(np->sethost);
       freesstring(np->opername);
+      if(!np->auth && np->authname)
+        free(np->authname);
     }
   }
 
@@ -176,18 +181,22 @@ void deletenick(nick *np) {
   releaserealname(np->realname);
   releasehost(np->host);
   
-  if(IsAccount(np) && np->auth)
-  {
-    np->auth->usercount--;
+  if(IsAccount(np)) {
+    if(!np->auth) {
+      if(np->authname)
+        free(np->authname);
+    } else {
+      np->auth->usercount--;
     
-    for (nh=&(np->auth->nicks);*nh;nh=&((*nh)->nextbyauthname)) {
-      if (*nh==np) {
-        *nh=np->nextbyauthname;
-        break;
+      for (nh=&(np->auth->nicks);*nh;nh=&((*nh)->nextbyauthname)) {
+        if (*nh==np) {
+          *nh=np->nextbyauthname;
+          break;
+        }
       }
-    }
     
-    releaseauthname(np->auth);
+      releaseauthname(np->auth);
+    }
   }
   
   freesstring(np->shident); /* freesstring(NULL) is OK */