Commit Diff


commit - 2e4d085df59a6c46ebe45a99a569aeff66a3af34
commit + 904d5e5b0944370b54229ef1295911532cc2c175
blob - c03fd801b3352986e54187c759f20e20f3e389bd
blob + 50dd469c6ec65af7f92f3bfa4db323962e00f1e8
--- src/ngircd/client.c
+++ src/ngircd/client.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: client.c,v 1.22 2002/01/05 20:08:17 alex Exp $
+ * $Id: client.c,v 1.23 2002/01/05 23:26:05 alex Exp $
  *
  * client.c: Management aller Clients
  *
@@ -21,6 +21,9 @@
  * Server gewesen, so existiert eine entsprechende CONNECTION-Struktur.
  *
  * $Log: client.c,v $
+ * Revision 1.23  2002/01/05 23:26:05  alex
+ * - Vorbereitungen fuer Ident-Abfragen in Client-Strukturen.
+ *
  * Revision 1.22  2002/01/05 20:08:17  alex
  * - neue Funktion Client_NextHop().
  *
@@ -184,28 +187,28 @@ GLOBAL CLIENT *Client_ThisServer( VOID )
 } /* Client_ThisServer */
 
 
-GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type )
+GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented )
 {
 	/* Neuen lokalen Client erzeugen: Wrapper-Funktion fuer Client_New(). */
-	return Client_New( Idx, This_Server, Type, NULL, NULL, Hostname, NULL, 0, 0, NULL );
+	return Client_New( Idx, This_Server, Type, NULL, NULL, Hostname, NULL, 0, 0, NULL, Idented );
 } /* Client_NewLocal */
 
 
-GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, INT Hops, INT Token, CHAR *Info )
+GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented )
 {
 	/* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
-	return Client_New( NONE, Introducer, CLIENT_SERVER, Hostname, NULL, Hostname, Info, Hops, Token, NULL );
+	return Client_New( NONE, Introducer, CLIENT_SERVER, Hostname, NULL, Hostname, Info, Hops, Token, NULL, Idented );
 } /* Client_NewRemoteServer */
 
 
-GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info )
+GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented )
 {
 	/* Neuen Remote-Client erzeugen: Wrapper-Funktion fuer Client_New (). */
-	return Client_New( NONE, Introducer, CLIENT_USER, Nick, User, Hostname, Info, Hops, Token, NULL );
+	return Client_New( NONE, Introducer, CLIENT_USER, Nick, User, Hostname, Info, Hops, Token, NULL, Idented );
 } /* Client_NewRemoteUser */
 
 
-GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes )
+GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented )
 {
 	CLIENT *client;
 
@@ -221,7 +224,7 @@ GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introd
 	client->introducer = Introducer;
 	client->type = Type;
 	if( ID ) Client_SetID( client, ID );
-	if( User ) Client_SetUser( client, User );
+	if( User ) Client_SetUser( client, User, Idented );
 	if( Hostname ) Client_SetHostname( client, Hostname );
 	if( Info ) Client_SetInfo( client, Info );
 	client->hops = Hops;
@@ -265,10 +268,10 @@ GLOBAL VOID Client_Destroy( CLIENT *Client )
 				if( c->conn_id != NONE )
 				{
 					/* Ein lokaler User. Andere Server informieren! */
-					Log( LOG_NOTICE, "User \"%s!%s@%s\" exited (connection %d).", c->id, c->user, c->host, c->conn_id );
+					Log( LOG_NOTICE, "User \"%s\" exited (connection %d).", c->id, c->conn_id );
 					IRC_WriteStrServersPrefix( NULL, c, "QUIT :" );
 				}
-				else Log( LOG_DEBUG, "User \"%s!%s@%s\" exited.", c->id, c->user, c->host );
+				else Log( LOG_DEBUG, "User \"%s\" exited.", c->id );
 			}
 			else if( c->type == CLIENT_SERVER ) Log( LOG_NOTICE, "Server \"%s\" exited.", c->id );
 			else Log( LOG_NOTICE, "Unknown client \"%s\" exited.", c->id );
@@ -302,12 +305,17 @@ GLOBAL VOID Client_SetID( CLIENT *Client, CHAR *ID )
 } /* Client_SetID */
 
 
-GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User )
+GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented )
 {
 	/* Username eines Clients setzen */
 
 	assert( Client != NULL );
-	strncpy( Client->user, User, CLIENT_USER_LEN );
+	if( Idented ) strncpy( Client->user, User, CLIENT_USER_LEN );
+	else
+	{
+		Client->user[0] = '~';
+		strncpy( Client->user + 1, User, CLIENT_USER_LEN - 1 );
+	}
 	Client->user[CLIENT_USER_LEN - 1] = '\0';
 } /* Client_SetUser */
 
blob - 2644a7f96e68616b5e195f7d812d844a2703af5b
blob + 4b159053e5393403cb6a903915798d8845ccba9b
--- src/ngircd/client.h
+++ src/ngircd/client.h
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: client.h,v 1.15 2002/01/05 20:08:17 alex Exp $
+ * $Id: client.h,v 1.16 2002/01/05 23:26:05 alex Exp $
  *
  * client.h: Konfiguration des ngircd (Header)
  *
  * $Log: client.h,v $
+ * Revision 1.16  2002/01/05 23:26:05  alex
+ * - Vorbereitungen fuer Ident-Abfragen in Client-Strukturen.
+ *
  * Revision 1.15  2002/01/05 20:08:17  alex
  * - neue Funktion Client_NextHop().
  *
@@ -112,10 +115,10 @@ typedef POINTER CLIENT;
 GLOBAL VOID Client_Init( VOID );
 GLOBAL VOID Client_Exit( VOID );
 
-GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type );
-GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, INT Hops, INT Token, CHAR *Info );
-GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info );
-GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes );
+GLOBAL CLIENT *Client_NewLocal( CONN_ID Idx, CHAR *Hostname, INT Type, BOOLEAN Idented );
+GLOBAL CLIENT *Client_NewRemoteServer( CLIENT *Introducer, CHAR *Hostname, INT Hops, INT Token, CHAR *Info, BOOLEAN Idented );
+GLOBAL CLIENT *Client_NewRemoteUser( CLIENT *Introducer, CHAR *Nick, INT Hops, CHAR *User, CHAR *Hostname, INT Token, CHAR *Modes, CHAR *Info, BOOLEAN Idented );
+GLOBAL CLIENT *Client_New( CONN_ID Idx, CLIENT *Introducer, INT Type, CHAR *ID, CHAR *User, CHAR *Hostname, CHAR *Info, INT Hops, INT Token, CHAR *Modes, BOOLEAN Idented );
 
 GLOBAL VOID Client_Destroy( CLIENT *Client );
 
@@ -148,7 +151,7 @@ GLOBAL BOOLEAN Client_HasMode( CLIENT *Client, CHAR Mo
 
 GLOBAL VOID Client_SetHostname( CLIENT *Client, CHAR *Hostname );
 GLOBAL VOID Client_SetID( CLIENT *Client, CHAR *Nick );
-GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User );
+GLOBAL VOID Client_SetUser( CLIENT *Client, CHAR *User, BOOLEAN Idented );
 GLOBAL VOID Client_SetInfo( CLIENT *Client, CHAR *Info );
 GLOBAL VOID Client_SetPassword( CLIENT *Client, CHAR *Pwd );
 GLOBAL VOID Client_SetType( CLIENT *Client, INT Type );