X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fchannel.c;h=c5dde86a99fb3117e1208c9a0a3e5760f826fd5f;hb=1d08d51e2eaff14b71f20d3f0898d5a86582b7e5;hp=971fe2f9c4cd28830c4bcdde0015865fff8907c1;hpb=6626395c88fc46eeb110942b17eb9245a1d0021b;p=ngircd-alex.git diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 971fe2f9..c5dde86a 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -17,14 +17,15 @@ #include "portab.h" -static char UNUSED id[] = "$Id: channel.c,v 1.41 2002/12/26 16:48:14 alex Exp $"; +static char UNUSED id[] = "$Id: channel.c,v 1.45 2004/03/11 22:16:31 alex Exp $"; #include "imp.h" #include #include #include +#include -#include "conn.h" +#include "conn-func.h" #include "client.h" #include "exp.h" @@ -669,7 +670,7 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ) { BOOLEAN is_member, has_voice, is_op, ok; - /* Okay, Ziel ist ein Channel */ + /* Okay, target is a channel */ is_member = has_voice = is_op = FALSE; if( Channel_IsMemberOf( Chan, From )) { @@ -678,14 +679,21 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ) if( strchr( Channel_UserModes( Chan, From ), 'o' )) is_op = TRUE; } - /* pruefen, ob Client in Channel schreiben darf */ + /* Check weather client is allowed to write to channel */ ok = TRUE; if( strchr( Channel_Modes( Chan ), 'n' ) && ( ! is_member )) ok = FALSE; if( strchr( Channel_Modes( Chan ), 'm' ) && ( ! is_op ) && ( ! has_voice )) ok = FALSE; + + /* Is the client banned? */ + if( Lists_CheckBanned( From, Chan )) + { + /* Client is banned, bus is he channel operator or has voice? */ + if(( ! has_voice ) && ( ! is_op )) ok = FALSE; + } if( ! ok ) return IRC_WriteStrClient( From, ERR_CANNOTSENDTOCHAN_MSG, Client_ID( From ), Channel_Name( Chan )); - /* Text senden */ + /* Send text */ if( Client_Conn( From ) > NONE ) Conn_UpdateIdle( Client_Conn( From )); return IRC_WriteStrChannelPrefix( Client, Chan, From, TRUE, "PRIVMSG %s :%s", Channel_Name( Chan ), Text ); } /* Channel_Write */ @@ -700,7 +708,7 @@ Channel_Create( CHAR *Name ) assert( Name != NULL ); - c = malloc( sizeof( CHANNEL )); + c = (CHANNEL *)malloc( sizeof( CHANNEL )); if( ! c ) { Log( LOG_EMERG, "Can't allocate memory! [New_Chan]" ); @@ -752,7 +760,7 @@ Add_Client( CHANNEL *Chan, CLIENT *Client ) assert( Client != NULL ); /* neue CL2CHAN-Struktur anlegen */ - cl2chan = malloc( sizeof( CL2CHAN )); + cl2chan = (CL2CHAN *)malloc( sizeof( CL2CHAN )); if( ! cl2chan ) { Log( LOG_EMERG, "Can't allocate memory! [Add_Client]" );