diff options
| author | Alexander Barton <alex@barton.de> | 2002-12-14 13:23:11 +0000 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2002-12-14 13:23:11 +0000 |
| commit | 00e75ccd7d3c43b1142c65ed2a26408efd1b9c5b (patch) | |
| tree | 2b10789faea546a2ab93dc26c0950e393617e20b /src | |
| parent | e907816380d02f913cc1f9c463f7835fc70fc0c0 (diff) | |
| download | ngircd-00e75ccd7d3c43b1142c65ed2a26408efd1b9c5b.tar.gz ngircd-00e75ccd7d3c43b1142c65ed2a26408efd1b9c5b.zip | |
- fixed up Conf_MaxJoins test on JOIN.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/irc-channel.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c index 52e24519..528751e4 100644 --- a/src/ngircd/irc-channel.c +++ b/src/ngircd/irc-channel.c @@ -14,7 +14,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: irc-channel.c,v 1.19 2002/12/13 17:53:32 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> @@ -83,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 ) { @@ -95,17 +105,6 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) chan = Channel_Search( channame ); assert( chan != NULL ); - /* Test if the user has reached his maximum channel count */ - if( Client_Type( Client ) == CLIENT_USER ) - { - if(( Conf_MaxJoins > 0 ) && ( Channel_CountForUser( chan, Client ) > Conf_MaxJoins )) - { - IRC_WriteStrClient( Client, ERR_TOOMANYCHANNELS_MSG, Client_ID( Client ), channame ); - return CONNECTED; - } - } - - is_banned = Lists_CheckBanned( target, chan ); is_invited = Lists_CheckInvited( target, chan ); |