Author: Perry Lorier <Isomer@coders.net>
[ircu2.10.12-pk.git] / ircd / m_server.c
index baaaf582629b12d664e97ed728389d152bf40907..3759a8e0a477a2f09d3c39c933b0eb84a861e6ce 100644 (file)
@@ -94,6 +94,7 @@
 #include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
+#include "jupe.h"
 #include "list.h"
 #include "match.h"
 #include "msg.h"
@@ -139,6 +140,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct ConfItem* aconf = 0;
   struct ConfItem* cconf;
   struct ConfItem* lhconf = 0;
+  struct Jupe*     ajupe = 0;
   int              hop;
   int              ret;
   int              active_lh_line = 0;
@@ -166,8 +168,13 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return need_more_params(sptr, "SERVER");
     return exit_client(cptr, cptr, &me, "Need more parameters");
   }
-  ircd_log(L_NOTICE, "SERVER: %s %s[%s]", parv[1], cptr->sockhost, cptr->sock_ip);
   host = parv[1];
+
+  if ((ajupe = jupe_find(host)) && JupeIsActive(ajupe))
+    return exit_client_msg(cptr, sptr, &me, "Juped: %s", JupeReason(ajupe));
+
+  ircd_log(L_NOTICE, "SERVER: %s %s[%s]", parv[1], cptr->sockhost, cptr->sock_ip);
+
   /*
    * Detect protocol
    */
@@ -393,7 +400,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      *  If my ircd.conf sucks, I can try to connect to myself:
      */
     if (acptr == &me)
-      return exit_client_msg(cptr, cptr, &me, "nick collision with me (%s)", host);
+      return exit_client_msg(cptr, cptr, &me, "nick collision with me (%s), check server number in M:?", host);
     /*
      * Detect wrong numeric.
      */
@@ -620,7 +627,8 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   {
     if (LHcptr == 0) {
       return exit_new_server(cptr, sptr, host, timestamp,
-          (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
+          (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s), check H:" : 
+                                   "Leaf-only link %s <- %s(%s), check L:",
           cptr->name, host, 
           lhconf ? (lhconf->name ? lhconf->name : "*") : "!");
     }
@@ -630,7 +638,8 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       if (active_lh_line < 3)
       {
         if (exit_client_msg(cptr, LHcptr, &me,
-            (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s)" : "Leaf-only link %s <- %s(%s)",
+            (active_lh_line == 2) ?  "Non-Hub link %s <- %s(%s), check H:" : 
+                                     "Leaf-only link %s <- %s(%s), check L:",
             cptr->name, host,
             lhconf ? (lhconf->name ? lhconf->name : "*") : "!") == CPTR_KILLED)
           return CPTR_KILLED;
@@ -638,7 +647,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       else
       {
         ServerStats->is_ref++;
-        if (exit_client(cptr, LHcptr, &me, "I'm a leaf") == CPTR_KILLED)
+        if (exit_client(cptr, LHcptr, &me, "I'm a leaf, define HUB") == CPTR_KILLED)
           return CPTR_KILLED;
       }
       /*
@@ -798,6 +807,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   struct ConfItem* aconf = 0;
   struct ConfItem* cconf;
   struct ConfItem* lhconf = 0;
+  struct Jupe*     ajupe = 0;
   int              hop;
   int              ret;
   int              active_lh_line = 0;
@@ -825,6 +835,10 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     return exit_client(cptr, cptr, &me, "Need more parameters");
   }
   host = parv[1];
+
+  if ((ajupe = jupe_find(host)) && JupeIsActive(ajupe))
+    jupe_resend(cptr, ajupe);
+
   /*
    * Detect protocol
    */
@@ -1052,7 +1066,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
      */
     if (acptr == &me)
       return exit_client_msg(cptr, cptr, &me,
-          "nick collision with me (%s)", host);
+          "nick collision with me, check server number in M:? (%s)", host);
     /*
      * Detect wrong numeric.
      */
@@ -1460,6 +1474,7 @@ int m_server(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
   struct ConfItem* aconf = 0;
   struct ConfItem* cconf;
   struct ConfItem* lhconf = 0;
+  struct Jupe*     ajupe = 0;
   int              hop;
   int              ret;
   int              active_lh_line = 0;
@@ -1716,7 +1731,7 @@ int m_server(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
      */
     if (acptr == &me)
       return exit_client_msg(cptr, cptr, &me,
-          "nick collision with me (%s)", host);
+          "nick collision with me, check server number in M:? (%s)", host);
     /*
      * Detect wrong numeric.
      */