]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.c
- weitere Anpassungen an Chennals, v.a. ueber Server-Links.
[ngircd-alex.git] / src / ngircd / client.c
index 285b51d78eeaf7c338697e343b78b3c2c0e95a50..dcabeb469e13cba41382946c645e366bed99ff74 100644 (file)
@@ -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.30 2002/01/18 15:32:01 alex Exp $
+ * $Id: client.c,v 1.33 2002/01/27 21:56:54 alex Exp $
  *
  * client.c: Management aller Clients
  *
  * Server gewesen, so existiert eine entsprechende CONNECTION-Struktur.
  *
  * $Log: client.c,v $
+ * Revision 1.33  2002/01/27 21:56:54  alex
+ * - weitere Anpassungen an Chennals, v.a. ueber Server-Links.
+ *
+ * Revision 1.32  2002/01/27 18:27:12  alex
+ * - Client_GetFromID() kommt nun auch mit Host-Masken zurecht.
+ *
+ * Revision 1.31  2002/01/21 00:08:50  alex
+ * - wird ein Client entfernt, so wird er auch aus allen Channels geloescht.
+ *
  * Revision 1.30  2002/01/18 15:32:01  alex
  * - bei Client_SetModes() wurde das NULL-Byte falsch gesetzt. Opsa.
  *
@@ -319,6 +328,7 @@ GLOBAL VOID Client_Destroy( CLIENT *Client, CHAR *LogMsg, CHAR *FwdMsg )
                                        if( FwdMsg ) IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "QUIT :%s", FwdMsg );
                                        else IRC_WriteStrServersPrefix( Client_NextHop( c ), c, "QUIT :" );
                                }
+                               Channel_RemoveClient( c, FwdMsg ? FwdMsg : c->id );
                        }
                        else if( c->type == CLIENT_SERVER )
                        {
@@ -514,13 +524,20 @@ GLOBAL CLIENT *Client_GetFromID( CHAR *Nick )
        * liefern. Wird keine gefunden, so wird NULL geliefert. */
 
        CLIENT *c;
+       CHAR nick[CLIENT_ID_LEN + 1], *ptr;
 
        assert( Nick != NULL );
 
+       strncpy( nick, Nick, CLIENT_ID_LEN );
+       nick[CLIENT_ID_LEN] = '\0';
+       
+       ptr = strchr( nick, '!' );
+       if( ptr ) *ptr = '\0';
+
        c = My_Clients;
        while( c )
        {
-               if( strcasecmp( c->id, Nick ) == 0 ) return c;
+               if( strcasecmp( c->id, nick ) == 0 ) return c;
                c = c->next;
        }
        return NULL;
@@ -879,7 +896,6 @@ LOCAL CLIENT *New_Client_Struct( VOID )
        /* Neue CLIENT-Struktur pre-initialisieren */
        
        CLIENT *c;
-       INT i;
        
        c = malloc( sizeof( CLIENT ));
        if( ! c )
@@ -897,7 +913,6 @@ LOCAL CLIENT *New_Client_Struct( VOID )
        strcpy( c->host, "" );
        strcpy( c->user, "" );
        strcpy( c->info, "" );
-       for( i = 0; i < MAX_CHANNELS; c->channels[i++] = NULL );
        strcpy( c->modes, "" );
        c->oper_by_me = FALSE;
        c->hops = -1;