Commit Diff


commit - 1f9ba7b326d05a681129f67f3f65853bb4969e76
commit + 378e511e044ce5e240d99b67bc24ebf18a274ffd
blob - e314fd9ffaf3648af078344a1f583f8bf6481992
blob + 50cce094c1f7b448fc17645a65b66ffab2f7600f
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
@@ -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 *Cl
 } /* 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 *
blob - a3967504b70af4b47c7d5fe16e906b7cd10e7bd8
blob + aad7b1878d9f9af8d0bc542eb5d93d2a64adef10
--- src/ngircd/channel.h
+++ src/ngircd/channel.h
@@ -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,7 +95,9 @@ GLOBAL BOOLEAN Channel_IsMemberOf PARAMS((CHANNEL *Cha
 
 GLOBAL BOOLEAN Channel_Write PARAMS((CHANNEL *Chan, CLIENT *From, CLIENT *Client, CHAR *Text ));
 
+GLOBAL CHANNEL *Channel_Create PARAMS((CHAR *Name ));
 
+
 #endif