]> jfr.im git - solanum.git/blobdiff - extensions/drain.c
explicitly show IP in SNO_BANNED snotes
[solanum.git] / extensions / drain.c
index 01d19cdf1912ad2b47d1049832254cc4862c8769..2b44567ee51c709373bd5205a8095bb763014201 100644 (file)
@@ -6,7 +6,7 @@
 
 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 }
 };
 
@@ -22,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);