X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fchannel.c;h=7f37dba6f3857420f720a136e079b6311a59b6a9;hp=386aaa2a1ad7f5166a31490746b822356e32f56c;hb=4f6f84e7e1bc015e201e8a79e13b0906dcb23ec1;hpb=e907816380d02f913cc1f9c463f7835fc70fc0c0 diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c index 386aaa2a..7f37dba6 100644 --- a/src/ngircd/channel.c +++ b/src/ngircd/channel.c @@ -17,7 +17,7 @@ #include "portab.h" -static char UNUSED id[] = "$Id: channel.c,v 1.37 2002/12/14 13:21:56 alex Exp $"; +static char UNUSED id[] = "$Id: channel.c,v 1.39 2002/12/25 13:22:43 alex Exp $"; #include "imp.h" #include @@ -350,6 +350,22 @@ Channel_Modes( CHANNEL *Chan ) } /* Channel_Modes */ +GLOBAL CHAR * +Channel_Key( CHANNEL *Chan ) +{ + assert( Chan != NULL ); + return Chan->key; +} /* Channel_Key */ + + +GLOBAL LONG +Channel_MaxUsers( CHANNEL *Chan ) +{ + assert( Chan != NULL ); + return Chan->maxusers; +} /* Channel_MaxUsers */ + + GLOBAL CHANNEL * Channel_First( VOID ) { @@ -452,7 +468,7 @@ Channel_IsValidName( CHAR *Name ) if(( Name[0] != '#' ) || ( strlen( Name ) >= CHANNEL_NAME_LEN )) return FALSE; ptr = Name; - strcpy( badchars, " ,:\x07" ); + strcpy( badchars, " ,:\007" ); while( *ptr ) { if( strchr( badchars, *ptr )) return FALSE; @@ -629,6 +645,27 @@ Channel_SetModes( CHANNEL *Chan, CHAR *Modes ) } /* Channel_SetModes */ +GLOBAL VOID +Channel_SetKey( CHANNEL *Chan, CHAR *Key ) +{ + assert( Chan != NULL ); + assert( Key != NULL ); + + strncpy( Chan->key, Key, CLIENT_PASS_LEN - 1 ); + Chan->key[CLIENT_PASS_LEN - 1] = '\0'; + Log( LOG_DEBUG, "Channel %s: Key is now \"%s\".", Chan->name, Chan->key ); +} /* Channel_SetKey */ + + +GLOBAL VOID +Channel_SetMaxUsers( CHANNEL *Chan, LONG Count ) +{ + assert( Chan != NULL ); + + Chan->maxusers = Count; + Log( LOG_DEBUG, "Channel %s: Member limit is now %ld.", Chan->name, Chan->maxusers ); +} /* Channel_SetMaxUsers */ + GLOBAL BOOLEAN Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ) @@ -678,6 +715,8 @@ Channel_Create( CHAR *Name ) strcpy( c->modes, "" ); strcpy( c->topic, "" ); c->hash = Hash( c->name ); + strcpy( c->key, "" ); + c->maxusers = 0; /* Verketten */ c->next = My_Channels;