]> jfr.im git - solanum.git/blobdiff - extensions/drain.c
explicitly show IP in SNO_BANNED snotes
[solanum.git] / extensions / drain.c
index 225a9d73ad2a9872385d3f1dfad94d1bbb3e285f..2b44567ee51c709373bd5205a8095bb763014201 100644 (file)
@@ -2,17 +2,11 @@
 #include "modules.h"
 #include "hook.h"
 #include "client.h"
-#include "ircd.h"
-#include "send.h"
-#include "hash.h"
 #include "s_conf.h"
-#include "s_user.h"
-#include "s_serv.h"
-#include "numeric.h"
 
 static void check_new_user(void *data);
 mapi_hfn_list_av1 drain_hfnlist[] = {
-       { "new_local_user", (hookfn) check_new_user },
+       { "new_local_user", check_new_user },
        { NULL, NULL }
 };
 
@@ -28,10 +22,13 @@ check_new_user(void *vdata)
        struct Client *source_p = vdata;
        const char *drain_reason = ConfigFileEntry.drain_reason;
 
+       if (IsAnyDead(source_p))
+               return;
+
        if (drain_reason == NULL)
                drain_reason = "This server is not accepting connections.";
 
-       if(IsExemptKline(source_p))
+       if (IsExemptKline(source_p))
                return;
 
        exit_client(source_p, source_p, &me, drain_reason);