]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-channel.c
- New functions Channel_[Set]Key(), Channel_[Set]MaxUsers.
[ngircd-alex.git] / src / ngircd / irc-channel.c
index 34dbe5e5dbd3c104da9c0be640fc9ec9ae8326e0..528751e48d0f013291ace866a66f071323f78967 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: irc-channel.c,v 1.18 2002/12/12 12:24:18 alex Exp $";
+static char UNUSED id[] = "$Id: irc-channel.c,v 1.20 2002/12/14 13:23:11 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -31,6 +31,8 @@ static char UNUSED id[] = "$Id: irc-channel.c,v 1.18 2002/12/12 12:24:18 alex Ex
 #include "parse.h"
 #include "irc-info.h"
 #include "irc-write.h"
+#include "resolve.h"
+#include "conf.h"
 
 #include "exp.h"
 #include "irc-channel.h"
@@ -81,6 +83,16 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
                /* Lokaler Client? */
                if( Client_Type( Client ) == CLIENT_USER )
                {
+                       /* Test if the user has reached his maximum channel count */
+                       if( Client_Type( Client ) == CLIENT_USER )
+                       {
+                               if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( Client ) >= Conf_MaxJoins ))
+                               {
+                                       IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG, Client_ID( Client ), channame );
+                                       return CONNECTED;
+                               }
+                       }
+
                        /* Existiert der Channel bereits, oder wird er im Moment neu erzeugt? */
                        if( is_new_chan )
                        {