Change Introduce_Client() to set the correct client type (user/service).

This commit is contained in:
Alexander Barton 2008-08-17 17:27:45 +02:00
parent 28e9888764
commit 6356418ae5
1 changed files with 15 additions and 16 deletions

View File

@ -40,7 +40,7 @@
static bool Hello_User PARAMS(( CLIENT *Client )); static bool Hello_User PARAMS(( CLIENT *Client ));
static void Kill_Nick PARAMS(( char *Nick, char *Reason )); static void Kill_Nick PARAMS(( char *Nick, char *Reason ));
static void Introduce_Client PARAMS((CLIENT *To, CLIENT *Client)); static void Introduce_Client PARAMS((CLIENT *To, CLIENT *Client, int Type));
static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix, static void cb_introduceClient PARAMS((CLIENT *Client, CLIENT *Prefix,
void *i)); void *i));
@ -364,7 +364,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
Client_Mask(c)); Client_Mask(c));
Client_SetType(c, CLIENT_GOTNICK); Client_SetType(c, CLIENT_GOTNICK);
} else } else
Introduce_Client(Client, c); Introduce_Client(Client, c, CLIENT_USER);
return CONNECTED; return CONNECTED;
} }
@ -448,7 +448,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
/* RFC 1459 style user registration? /* RFC 1459 style user registration?
* Introduce client to network: */ * Introduce client to network: */
if (Client_Type(c) == CLIENT_GOTNICK) if (Client_Type(c) == CLIENT_GOTNICK)
Introduce_Client(Client, c); Introduce_Client(Client, c, CLIENT_USER);
return CONNECTED; return CONNECTED;
} else if (Client_Type(Client) == CLIENT_USER) { } else if (Client_Type(Client) == CLIENT_USER) {
@ -678,7 +678,7 @@ Hello_User(CLIENT * Client)
return DISCONNECTED; return DISCONNECTED;
} }
Introduce_Client(NULL, Client); Introduce_Client(NULL, Client, CLIENT_USER);
if (!IRC_WriteStrClient if (!IRC_WriteStrClient
(Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client))) (Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
@ -733,25 +733,24 @@ Kill_Nick( char *Nick, char *Reason )
static void static void
Introduce_Client(CLIENT *From, CLIENT *Client) Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
{ {
char *type; /* Set client type (user or service) */
Client_SetType(Client, Type);
Client_SetType(Client, CLIENT_USER);
if (From) { if (From) {
if (Conf_IsService(Conf_GetServer(Client_Conn(From)), Client_ID(Client))) { if (Conf_IsService(Conf_GetServer(Client_Conn(From)),
type = "Service"; Client_ID(Client)))
Client_SetType(Client, CLIENT_SERVICE); Client_SetType(Client, CLIENT_SERVICE);
} else
type = "User";
LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).", LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
type, Client_Mask(Client), Client_Modes(Client), Client_TypeText(Client), Client_Mask(Client),
Client_ID(From), Client_ID(Client_Introducer(Client)), Client_Modes(Client), Client_ID(From),
Client_ID(Client_Introducer(Client)),
Client_Hops(Client), Client_Hops(Client) > 1 ? "s": ""); Client_Hops(Client), Client_Hops(Client) > 1 ? "s": "");
} else } else
Log(LOG_NOTICE, "User \"%s\" registered (connection %d).", Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).",
Client_Mask(Client), Client_Conn(Client)); Client_TypeText(Client), Client_Mask(Client),
Client_Conn(Client));
/* Inform other servers */ /* Inform other servers */
IRC_WriteStrServersPrefixFlag_CB(From, IRC_WriteStrServersPrefixFlag_CB(From,