X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fchannel.c;h=57ca90a39d7a4ec96e581b903b9831a869d94247;hb=57c7e2362284c8c9937f32944ec985b53b1b07d6;hp=c50398940a3c2c827267cc4abf8c42dc2d000631;hpb=0ced4181b032249a5ccab2a6ae1d61bf08f60293;p=ngircd-alex.git diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index c5039894..57ca90a3 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.40 2002/12/26 16:25:43 alex Exp $"; +static char UNUSED id[] = "$Id: channel.c,v 1.44 2004/01/17 03:17:49 alex Exp $"; #include "imp.h" #include #include #include +#include -#include "conn.h" +#include "conn-func.h" #include "client.h" #include "exp.h" @@ -494,7 +495,7 @@ Channel_ModeAdd( CHANNEL *Chan, CHAR Mode ) if( ! strchr( Chan->modes, x[0] )) { /* Client hat den Mode noch nicht -> setzen */ - strcat( Chan->modes, x ); + strlcat( Chan->modes, x, sizeof( Chan->modes )); return TRUE; } else return FALSE; @@ -547,7 +548,7 @@ Channel_UserModeAdd( CHANNEL *Chan, CLIENT *Client, CHAR Mode ) if( ! strchr( cl2chan->modes, x[0] )) { /* Client hat den Mode noch nicht -> setzen */ - strcat( cl2chan->modes, x ); + strlcat( cl2chan->modes, x, sizeof( cl2chan->modes )); return TRUE; } else return FALSE; @@ -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 */