Centralize logging functions in Introduce_Client().
This commit is contained in:
parent
557be8c56b
commit
c5342fb467
|
@ -367,18 +367,12 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
|
||||||
* other servers about the new user.
|
* other servers about the new user.
|
||||||
* RFC 1459: announce the new client only after receiving the
|
* RFC 1459: announce the new client only after receiving the
|
||||||
* USER command, first we need more information! */
|
* USER command, first we need more information! */
|
||||||
if (Req->argc >= 7) {
|
if (Req->argc < 7) {
|
||||||
modes = Client_Modes(c);
|
|
||||||
LogDebug("User \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
|
|
||||||
Client_Mask(c), modes, Client_ID(Client),
|
|
||||||
Client_ID(intr_c), Client_Hops(c),
|
|
||||||
Client_Hops(c) > 1 ? "s": "");
|
|
||||||
Introduce_Client(Client, c);
|
|
||||||
} else {
|
|
||||||
LogDebug("User \"%s\" is beeing registered (RFC 1459) ...",
|
LogDebug("User \"%s\" is beeing registered (RFC 1459) ...",
|
||||||
Client_Mask(c));
|
Client_Mask(c));
|
||||||
Client_SetType(c, CLIENT_GOTNICK);
|
Client_SetType(c, CLIENT_GOTNICK);
|
||||||
}
|
} else
|
||||||
|
Introduce_Client(Client, c);
|
||||||
|
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
}
|
}
|
||||||
|
@ -459,15 +453,10 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
|
||||||
LogDebug("Connection %d: got valid USER command for \"%s\".",
|
LogDebug("Connection %d: got valid USER command for \"%s\".",
|
||||||
Client_Conn(Client), Client_Mask(c));
|
Client_Conn(Client), Client_Mask(c));
|
||||||
|
|
||||||
/* RFC 1459 style user registration? Inform other servers! */
|
/* RFC 1459 style user registration?
|
||||||
if (Client_Type(c) == CLIENT_GOTNICK) {
|
* Introduce client to network: */
|
||||||
LogDebug("User \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
|
if (Client_Type(c) == CLIENT_GOTNICK)
|
||||||
Client_Mask(c), Client_Modes(c), Client_ID(Client),
|
|
||||||
Client_ID(Client_Introducer(c)), Client_Hops(c),
|
|
||||||
Client_Hops(c) > 1 ? "s": "");
|
|
||||||
Client_SetType(c, CLIENT_USER);
|
|
||||||
Introduce_Client(Client, c);
|
Introduce_Client(Client, c);
|
||||||
}
|
|
||||||
|
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
} else if (Client_Type(Client) == CLIENT_USER) {
|
} else if (Client_Type(Client) == CLIENT_USER) {
|
||||||
|
@ -697,11 +686,6 @@ Hello_User(CLIENT * Client)
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
Client_SetType(Client, CLIENT_USER);
|
|
||||||
Log(LOG_NOTICE, "User \"%s\" registered (connection %d).",
|
|
||||||
Client_Mask(Client), Client_Conn(Client));
|
|
||||||
|
|
||||||
/* Inform other servers */
|
|
||||||
Introduce_Client(NULL, Client);
|
Introduce_Client(NULL, Client);
|
||||||
|
|
||||||
if (!IRC_WriteStrClient
|
if (!IRC_WriteStrClient
|
||||||
|
@ -759,6 +743,18 @@ Kill_Nick( char *Nick, char *Reason )
|
||||||
static void
|
static void
|
||||||
Introduce_Client(CLIENT *From, CLIENT *Client)
|
Introduce_Client(CLIENT *From, CLIENT *Client)
|
||||||
{
|
{
|
||||||
|
Client_SetType(Client, CLIENT_USER);
|
||||||
|
|
||||||
|
if (From) {
|
||||||
|
LogDebug("User \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
|
||||||
|
Client_Mask(Client), Client_Modes(Client),
|
||||||
|
Client_ID(From), Client_ID(Client_Introducer(Client)),
|
||||||
|
Client_Hops(Client), Client_Hops(Client) > 1 ? "s": "");
|
||||||
|
} else
|
||||||
|
Log(LOG_NOTICE, "User \"%s\" registered (connection %d).",
|
||||||
|
Client_Mask(Client), Client_Conn(Client));
|
||||||
|
|
||||||
|
/* Inform other servers */
|
||||||
IRC_WriteStrServersPrefixFlag_CB(From,
|
IRC_WriteStrServersPrefixFlag_CB(From,
|
||||||
From != NULL ? From : Client_ThisServer(),
|
From != NULL ? From : Client_ThisServer(),
|
||||||
'\0', cb_introduceClient, (void *)Client);
|
'\0', cb_introduceClient, (void *)Client);
|
||||||
|
|
Loading…
Reference in New Issue