#include "portab.h"
-static char UNUSED id[] = "$Id: irc-channel.c,v 1.36 2006/10/05 18:26:54 fw Exp $";
+static char UNUSED id[] = "$Id: irc-channel.c,v 1.39 2006/12/07 17:57:20 fw Exp $";
#include "imp.h"
#include <assert.h>
chan = NULL; flags = NULL;
/* wird der Channel neu angelegt? */
- if( Channel_Search( channame )) is_new_chan = false;
- else is_new_chan = true;
+ if( Channel_Search( channame )) {
+ is_new_chan = false;
+ } else {
+ if (Conf_PredefChannelsOnly) { /* this server does not allow creation of channels */
+ IRC_WriteStrClient( Client, ERR_BANNEDFROMCHAN_MSG, Client_ID( Client ), channame );
+ /* Try next name, if any */
+ channame = strchr(channame, ',');
+ continue;
+ }
+ is_new_chan = true;
+ }
/* Hat ein Server Channel-User-Modes uebergeben? */
if( Client_Type( Client ) == CLIENT_SERVER )
chan = Channel_Search( channame );
assert( chan != NULL );
- is_banned = Lists_CheckBanned( target, chan );
- is_invited = Lists_CheckInvited( target, chan );
+ is_banned = Lists_Check(Channel_GetListBans(chan), target );
+ is_invited = Lists_Check(Channel_GetListInvites(chan), target );
/* Testen, ob Client gebanned ist */
if(( is_banned == true) && ( is_invited == false ))
* commands) in this list become deleted when a user
* joins a channel this way. */
chan = Channel_Search( channame );
- if( chan != NULL ) (void)Lists_CheckInvited( target, chan );
+ if( chan != NULL ) (void)Lists_Check(Channel_GetListInvites(chan), target);
}
/* Channel joinen (und ggf. anlegen) */
{
if( *ptr == 'l' )
{
- snprintf( l, sizeof( l ), " %ld", Channel_MaxUsers( chan ));
+ snprintf( l, sizeof( l ), " %lu", Channel_MaxUsers( chan ));
strlcat( modes_add, l, sizeof( modes_add ));
}
if( *ptr == 'k' )