about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2008-08-17 17:27:45 +0200
committerAlexander Barton <alex@barton.de>2008-09-23 11:53:16 +0200
commit6356418ae5fd66f94abda78f1ae67bbc7a59b0e4 (patch)
treec6c0736f7626bb1ae9f7c158d09aa5d2b669b944 /src
parent28e98887643bf881c11ba3b8df5e9cbcc7e967ba (diff)
downloadngircd-6356418ae5fd66f94abda78f1ae67bbc7a59b0e4.tar.gz
ngircd-6356418ae5fd66f94abda78f1ae67bbc7a59b0e4.zip
Change Introduce_Client() to set the correct client type (user/service).
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-login.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c
index 9a04a3f7..c189228a 100644
--- a/src/ngircd/irc-login.c
+++ b/src/ngircd/irc-login.c
@@ -40,7 +40,7 @@
 
 static bool Hello_User PARAMS(( CLIENT *Client ));
 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,
 				       void *i));
 
@@ -364,7 +364,7 @@ IRC_NICK( CLIENT *Client, REQUEST *Req )
 				 Client_Mask(c));
 			Client_SetType(c, CLIENT_GOTNICK);
 		} else
-			Introduce_Client(Client, c);
+			Introduce_Client(Client, c, CLIENT_USER);
 
 		return CONNECTED;
 	}
@@ -448,7 +448,7 @@ IRC_USER(CLIENT * Client, REQUEST * Req)
 		/* RFC 1459 style user registration?
 		 * Introduce client to network: */
 		if (Client_Type(c) == CLIENT_GOTNICK)
-			Introduce_Client(Client, c);
+			Introduce_Client(Client, c, CLIENT_USER);
 
 		return CONNECTED;
 	} else if (Client_Type(Client) == CLIENT_USER) {
@@ -678,7 +678,7 @@ Hello_User(CLIENT * Client)
 		return DISCONNECTED;
 	}
 
-	Introduce_Client(NULL, Client);
+	Introduce_Client(NULL, Client, CLIENT_USER);
 
 	if (!IRC_WriteStrClient
 	    (Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
@@ -733,25 +733,24 @@ Kill_Nick( char *Nick, char *Reason )
 
 
 static void
-Introduce_Client(CLIENT *From, CLIENT *Client)
+Introduce_Client(CLIENT *From, CLIENT *Client, int Type)
 {
-	char *type;
-
-	Client_SetType(Client, CLIENT_USER);
+	/* Set client type (user or service) */
+	Client_SetType(Client, Type);
 
 	if (From) {
-		if (Conf_IsService(Conf_GetServer(Client_Conn(From)), Client_ID(Client))) {
-			type = "Service";
+		if (Conf_IsService(Conf_GetServer(Client_Conn(From)),
+				   Client_ID(Client)))
 			Client_SetType(Client, CLIENT_SERVICE);
-		} else
-			type = "User";
 		LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",
-			 type, Client_Mask(Client), Client_Modes(Client),
-			 Client_ID(From), Client_ID(Client_Introducer(Client)),
+			 Client_TypeText(Client), 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));
+		Log(LOG_NOTICE, "%s \"%s\" registered (connection %d).",
+		    Client_TypeText(Client), Client_Mask(Client),
+		    Client_Conn(Client));
 
 	/* Inform other servers */
 	IRC_WriteStrServersPrefixFlag_CB(From,