]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Client_CheckID(): fix connection information
authorAlexander Barton <alex@barton.de>
Fri, 17 Jul 2009 14:16:04 +0000 (16:16 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 17 Jul 2009 14:16:04 +0000 (16:16 +0200)
This patch fixes the following silly log messages:
'ID "XXX" already registered (on connection -1)!'

If the ID is already registered on a local connection, the local
connection ID is printed; and if the ID is connected via a remote
server, "via network" is displayed.

src/ngircd/client.c

index 50648c97ef81842807305cd330cd5643ed6c81a6..1edc7550e1f4e8c3ec9db65f952ca32d766ab241 100644 (file)
@@ -758,18 +758,18 @@ Client_CheckID( CLIENT *Client, char *ID )
        assert( Client->conn_id > NONE );
        assert( ID != NULL );
 
-       /* Nick too long? */
+       /* ID too long? */
        if (strlen(ID) > CLIENT_ID_LEN) {
                IRC_WriteStrClient(Client, ERR_ERRONEUSNICKNAME_MSG, Client_ID(Client), ID);
                return false;
        }
 
-       /* does ID already exist? */
+       /* ID already in use? */
        c = My_Clients;
        while (c) {
                if (strcasecmp(c->id, ID) == 0) {
                        snprintf(str, sizeof(str), "ID \"%s\" already registered", ID);
-                       if (Client->conn_id != c->conn_id)
+                       if (c->conn_id != NONE)
                                Log(LOG_ERR, "%s (on connection %d)!", str, c->conn_id);
                        else
                                Log(LOG_ERR, "%s (via network)!", str);