]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Move check for required CAPABs to mr_server -- CAPAB may not be sent.
authorJilles Tjoelker <redacted>
Tue, 21 Apr 2009 16:43:07 +0000 (18:43 +0200)
committerJilles Tjoelker <redacted>
Tue, 21 Apr 2009 16:43:07 +0000 (18:43 +0200)
Also fix exit message.

modules/core/m_server.c
modules/m_capab.c

index e4abd359dd954f9218e98db8874585e27d4bf222..fc9a453e9371625ae56ab6b28132b4372b580d91 100644 (file)
@@ -75,6 +75,7 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
        const char *name;
        struct Client *target_p;
        int hop;
+       struct Capability *cap;
 
        name = parv[1];
        hop = atoi(parv[2]);
@@ -108,6 +109,23 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
                return 0;
        }
 
+       /* check to ensure any "required" caps are set. --nenolod */
+       for (cap = captab; cap->name; cap++)
+       {
+               if (!cap->required)
+                       continue;
+
+               if (!(client_p->localClient->caps & cap->cap))
+               {
+                       char exitbuf[BUFSIZE];
+
+                       rb_snprintf(exitbuf, BUFSIZE, "Missing required CAPAB [%s]", cap->name);
+                       exit_client(client_p, client_p, client_p, exitbuf);
+
+                       return 0;
+               }
+       }
+
        /* Now we just have to call check_server and everything should be
         * check for us... -A1kmm. */
        switch (check_server(name, client_p))
index 650d8ab43324ad58f807b43b602df4b795cc974a..227a9972f4e6b5109644338e3b2437e0281d56c3 100644 (file)
@@ -96,23 +96,6 @@ mr_capab(struct Client *client_p, struct Client *source_p, int parc, const char
                }
        }
 
-       /* check to ensure any "required" caps are set. --nenolod */
-       for (cap = captab; cap->name; cap++)
-       {
-               if (!cap->required)
-                       continue;
-
-               if (!(client_p->localClient->caps & cap->cap))
-               {
-                       char exitbuf[BUFSIZE];
-
-                       rb_snprintf(exitbuf, BUFSIZE, "Missing required CAPAB [%s]", cap->cap);
-                       exit_client(client_p, client_p, client_p, exitbuf);
-
-                       return 0;
-               }
-       }
-
        return 0;
 }