Automatically stop most user-oriented hooks if the user becomes dead.
[srvx.git] / src / proto-p10.c
index e9ab2f44c8660f1b4ea81dd26ab4b70f8c5af172..d288524497a75ee28fcfb4070e14372fdce8b622 100644 (file)
@@ -1591,9 +1591,6 @@ static CMD_FUNC(cmd_svsnick)
     return 1;
 }
 
-static oper_func_t *of_list;
-static unsigned int of_size = 0, of_used = 0;
-
 void
 free_user(struct userNode *user)
 {
@@ -2141,7 +2138,7 @@ AddUser(struct server* uplink, const char *nick, const char *ident, const char *
     }
     if (IsLocal(uNode))
         irc_user(uNode);
-    for (n=0; n<nuf_used; n++)
+    for (n=0; (n<nuf_used) && !uNode->dead; n++)
         if (nuf_list[n](uNode))
             break;
     return uNode;
@@ -2821,31 +2818,6 @@ unreg_notice_func(struct userNode *user)
     notice_funcs[user->num_local] = NULL;
 }
 
-void
-reg_oper_func(oper_func_t handler)
-{
-    if (of_used == of_size) {
-        if (of_size) {
-            of_size <<= 1;
-            of_list = realloc(of_list, of_size*sizeof(oper_func_t));
-        } else {
-            of_size = 8;
-            of_list = malloc(of_size*sizeof(oper_func_t));
-        }
-    }
-    of_list[of_used++] = handler;
-}
-
-static void
-call_oper_funcs(struct userNode *user)
-{
-    unsigned int n;
-    if (IsLocal(user))
-        return;
-    for (n=0; n<of_used; n++)
-        of_list[n](user);
-}
-
 static void
 send_burst(void)
 {