]> jfr.im git - irc/quakenet/newserv.git/blobdiff - helpmod2/haccount.c
Implement --help parameter.
[irc/quakenet/newserv.git] / helpmod2 / haccount.c
index 3bb649e3ffb83f2f88782bf1659c61705acbf455..ec9e15221ae4fb78b4a2eb0f91c250a0c5ac3468 100644 (file)
@@ -33,6 +33,12 @@ haccount *haccount_add(const char *name, hlevel lvl)
 {
     haccount *tmp = (haccount*)malloc(sizeof (haccount));
 
+    if (haccount_get_by_name(name))
+    {
+       Error("helpmod", ERR_ERROR, "Attempt to add a duplicate account: %s", name);
+       return haccount_get_by_name(name);
+    }
+
     if (*name == '#')
         name++;
 
@@ -84,9 +90,9 @@ void haccount_clear_inactives(void)
 {
     haccount **ptr = &haccounts;
     while (*ptr)
-        if (time(NULL) - (*ptr)->last_activity > HELPMOD_ACCOUNT_EXPIRATION[(*ptr)->level])
-            haccount_del(*ptr);
-        else
+       if ((time(NULL) - (*ptr)->last_activity > HELPMOD_ACCOUNT_EXPIRATION[(*ptr)->level]) && !((*ptr)->flags & H_NO_EXPIRE))
+           haccount_del(*ptr);
+       else
             ptr = &(*ptr)->next;
 }
 
@@ -100,9 +106,9 @@ void haccount_set_level(haccount *hack, hlevel lvl)
 const char *haccount_get_state(haccount* hacc, int mask)
 {
     if (hacc->flags & mask)
-        return "On";
+        return "Yes";
     else
-        return "Off";
+        return "No";
 }
 
 int haccount_count(hlevel lvl)
@@ -134,6 +140,6 @@ const char *haccount_get_sname(int index)
     case 5:
         return "Suppress unknown command error";
     default:
-        return "error. Please contact strutsi";
+        return "Error. Please contact strutsi";
     }
 }