mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-13 02:10:27 +00:00
- New_Chan() in Channel_Create() umbenannt; entsprechende Anpassungen.
- Neue Funktion Channel_SetModes().
This commit is contained in:
parent
1f9ba7b326
commit
378e511e04
@ -9,7 +9,7 @@
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: channel.c,v 1.31 2002/09/02 18:23:35 alex Exp $
|
||||
* $Id: channel.c,v 1.32 2002/09/03 23:57:57 alex Exp $
|
||||
*
|
||||
* channel.c: Management der Channels
|
||||
*/
|
||||
@ -52,7 +52,6 @@ LOCAL CHANNEL *My_Channels;
|
||||
LOCAL CL2CHAN *My_Cl2Chan;
|
||||
|
||||
|
||||
LOCAL CHANNEL *New_Chan PARAMS(( CHAR *Name ));
|
||||
LOCAL CL2CHAN *Get_Cl2Chan PARAMS(( CHANNEL *Chan, CLIENT *Client ));
|
||||
LOCAL CL2CHAN *Add_Client PARAMS(( CHANNEL *Chan, CLIENT *Client ));
|
||||
LOCAL BOOLEAN Remove_Client PARAMS(( INT Type, CHANNEL *Chan, CLIENT *Client, CLIENT *Origin, CHAR *Reason, BOOLEAN InformServer ));
|
||||
@ -91,12 +90,9 @@ Channel_InitPredefined( VOID )
|
||||
}
|
||||
|
||||
/* Channel anlegen */
|
||||
chan = New_Chan( Conf_Channel[i].name );
|
||||
chan = Channel_Create( Conf_Channel[i].name );
|
||||
if( chan )
|
||||
{
|
||||
/* Verketten */
|
||||
chan->next = My_Channels;
|
||||
My_Channels = chan;
|
||||
Channel_ModeAdd( chan, 'P' );
|
||||
Channel_SetTopic( chan, Conf_Channel[i].topic );
|
||||
c = Conf_Channel[i].modes;
|
||||
@ -159,12 +155,8 @@ Channel_Join( CLIENT *Client, CHAR *Name )
|
||||
else
|
||||
{
|
||||
/* Gibt es noch nicht? Dann neu anlegen: */
|
||||
chan = New_Chan( Name );
|
||||
chan = Channel_Create( Name );
|
||||
if( ! chan ) return FALSE;
|
||||
|
||||
/* Verketten */
|
||||
chan->next = My_Channels;
|
||||
My_Channels = chan;
|
||||
}
|
||||
|
||||
/* User dem Channel hinzufuegen */
|
||||
@ -577,6 +569,18 @@ Channel_SetTopic( CHANNEL *Chan, CHAR *Topic )
|
||||
} /* Channel_SetTopic */
|
||||
|
||||
|
||||
GLOBAL VOID
|
||||
Channel_SetModes( CHANNEL *Chan, CHAR *Modes )
|
||||
{
|
||||
assert( Chan != NULL );
|
||||
assert( Modes != NULL );
|
||||
|
||||
strncpy( Chan->modes, Modes, CHANNEL_MODE_LEN - 1 );
|
||||
Chan->topic[CHANNEL_MODE_LEN - 1] = '\0';
|
||||
} /* Channel_SetModes */
|
||||
|
||||
|
||||
|
||||
GLOBAL BOOLEAN
|
||||
Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
|
||||
{
|
||||
@ -604,9 +608,8 @@ Channel_Write( CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text )
|
||||
} /* Channel_Write */
|
||||
|
||||
|
||||
|
||||
LOCAL CHANNEL *
|
||||
New_Chan( CHAR *Name )
|
||||
GLOBAL CHANNEL *
|
||||
Channel_Create( CHAR *Name )
|
||||
{
|
||||
/* Neue Channel-Struktur anlegen */
|
||||
|
||||
@ -627,10 +630,14 @@ New_Chan( CHAR *Name )
|
||||
strcpy( c->topic, "" );
|
||||
c->hash = Hash( c->name );
|
||||
|
||||
/* Verketten */
|
||||
c->next = My_Channels;
|
||||
My_Channels = c;
|
||||
|
||||
Log( LOG_DEBUG, "Created new channel structure for \"%s\".", Name );
|
||||
|
||||
return c;
|
||||
} /* New_Chan */
|
||||
} /* Channel_Create */
|
||||
|
||||
|
||||
LOCAL CL2CHAN *
|
||||
|
@ -9,7 +9,7 @@
|
||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||
*
|
||||
* $Id: channel.h,v 1.20 2002/06/02 17:13:07 alex Exp $
|
||||
* $Id: channel.h,v 1.21 2002/09/03 23:57:57 alex Exp $
|
||||
*
|
||||
* channel.h: Management der Channels (Header)
|
||||
*/
|
||||
@ -67,6 +67,7 @@ GLOBAL CHAR *Channel_Modes PARAMS((CHANNEL *Chan ));
|
||||
GLOBAL CHAR *Channel_Topic PARAMS((CHANNEL *Chan ));
|
||||
|
||||
GLOBAL VOID Channel_SetTopic PARAMS((CHANNEL *Chan, CHAR *Topic ));
|
||||
GLOBAL VOID Channel_SetModes PARAMS((CHANNEL *Chan, CHAR *Modes ));
|
||||
|
||||
GLOBAL CHANNEL *Channel_Search PARAMS((CHAR *Name ));
|
||||
|
||||
@ -94,6 +95,8 @@ GLOBAL BOOLEAN Channel_IsMemberOf PARAMS((CHANNEL *Chan, CLIENT *Client ));
|
||||
|
||||
GLOBAL BOOLEAN Channel_Write PARAMS((CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ));
|
||||
|
||||
GLOBAL CHANNEL *Channel_Create PARAMS((CHAR *Name ));
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user