about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2001-12-27 19:13:47 +0000
committerAlexander Barton <alex@barton.de>2001-12-27 19:13:47 +0000
commit15764f98460764b4295fc089b0f7314237cd5f15 (patch)
tree9c1fd6428b86781953264302c4e88e05150923e1 /src
parent4c6a99cf0b7b0d613eafc6ea7e19e1e10616fd4d (diff)
downloadngircd-15764f98460764b4295fc089b0f7314237cd5f15.tar.gz
ngircd-15764f98460764b4295fc089b0f7314237cd5f15.zip
- neue Funktion Client_Search(), besseres Logging.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/client.c27
-rw-r--r--src/ngircd/client.h6
2 files changed, 31 insertions, 2 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 6aca9216..6ce42397 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: client.c,v 1.9 2001/12/27 17:15:29 alex Exp $
+ * $Id: client.c,v 1.10 2001/12/27 19:13:47 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.10  2001/12/27 19:13:47  alex
+ * - neue Funktion Client_Search(), besseres Logging.
+ *
  * Revision 1.9  2001/12/27 17:15:29  alex
  * - der eigene Hostname wird nun komplet (als FQDN) ermittelt.
  *
@@ -170,6 +173,9 @@ GLOBAL VOID Client_Destroy( CLIENT *Client )
 		{
 			if( last ) last->next = c->next;
 			else My_Clients = c->next;
+
+			if( c->type == CLIENT_USER ) Log( LOG_INFO, "User \"%s!%s@%s\" (%s) exited.", c->nick, c->user, c->host, c->name );
+
 			free( c );
 			break;
 		}
@@ -250,6 +256,25 @@ GLOBAL CHAR *Client_GetID( CLIENT *Client )
 } /* Client_GetID */
 
 
+GLOBAL CLIENT *Client_Search( CHAR *ID )
+{
+	/* Client suchen, auf den ID passt */
+
+	CLIENT *c;
+
+	assert( ID != NULL );
+
+	c = My_Clients;
+	while( c )
+	{
+		if( strcasecmp( c->nick, ID ) == 0 ) return c;
+		c = c->next;
+	}
+	
+	return NULL;
+} /* Client_Search */
+
+
 LOCAL CLIENT *New_Client_Struct( VOID )
 {
 	/* Neue CLIENT-Struktur pre-initialisieren */
diff --git a/src/ngircd/client.h b/src/ngircd/client.h
index 85033aa7..fa721680 100644
--- a/src/ngircd/client.h
+++ b/src/ngircd/client.h
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: client.h,v 1.6 2001/12/27 16:54:51 alex Exp $
+ * $Id: client.h,v 1.7 2001/12/27 19:13:47 alex Exp $
  *
  * client.h: Konfiguration des ngircd (Header)
  *
  * $Log: client.h,v $
+ * Revision 1.7  2001/12/27 19:13:47  alex
+ * - neue Funktion Client_Search(), besseres Logging.
+ *
  * Revision 1.6  2001/12/27 16:54:51  alex
  * - neue Funktion Client_GetID(), liefert die "Client ID".
  *
@@ -91,6 +94,7 @@ GLOBAL CLIENT *Client_GetFromConn( CONN_ID Idx );
 GLOBAL CHAR *Client_Name( CLIENT *Client );
 GLOBAL BOOLEAN Client_CheckNick( CLIENT *Client, CHAR *Nick );
 GLOBAL CHAR *Client_GetID( CLIENT *Client );
+GLOBAL CLIENT *Client_Search( CHAR *ID );
 
 
 #endif