]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
Fix sending of JOINs between servers.
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 3ffd85a0196ce035cff2e73d848bbe733bf29954..55770571f61b68b13d39d60bc89abad0100b1642 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-channel.c,v 1.44 2008/02/16 11:21:33 fw Exp $";
+static char UNUSED id[] = "$Id: irc-channel.c,v 1.45 2008/02/24 18:57:38 fw Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -217,13 +217,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
        while (channame) {
                flags = NULL;
 
-               chan = Channel_Search(channame);
-               if (!chan && Conf_PredefChannelsOnly) {
-                        /* channel must be created, but server does not allow this */
-                       IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG, Client_ID(Client), channame);
-                       break;
-               }
-
                /* Did the server include channel-user-modes? */
                if (Client_Type(Client) == CLIENT_SERVER) {
                        flags = strchr(channame, 0x7);
@@ -233,6 +226,13 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
                        }
                }
 
+               chan = Channel_Search(channame);
+               if (!chan && Conf_PredefChannelsOnly) {
+                        /* channel must be created, but server does not allow this */
+                       IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG, Client_ID(Client), channame);
+                       break;
+               }
+
                /* Local client? */
                if (Client_Type(Client) == CLIENT_USER) {
                        /* Test if the user has reached his maximum channel count */