This patch fixes the wrong logging output when nested servers are introduced
to the network as well as the wrong output of the LINKS command regarding
the server tree.

Alexander Barton, <alex@barton.de>

 irc-server.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Index: src/ngircd/irc-server.c
===================================================================
RCS file: /srv/cvs/ngircd/ngircd/src/ngircd/irc-server.c,v
retrieving revision 1.43
diff -u -p -r1.43 irc-server.c
--- src/ngircd/irc-server.c	7 Dec 2006 17:57:20 -0000	1.43
+++ src/ngircd/irc-server.c	15 Nov 2007 02:33:28 -0000
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2006 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2007 Alexander Barton (alex@barton.de)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -83,8 +83,6 @@ Synchronize_Lists( CLIENT *Client )
 #endif
 
 
-
-
 /**
  * Handler for the IRC command "SERVER".
  * See RFC 2813 section 4.1.2.
@@ -209,8 +207,13 @@ IRC_SERVER( CLIENT *Client, REQUEST *Req
 						if( ! IRC_WriteStrClient( c, "SERVER %s %d %d :%s", Client_ID( Client ), Client_Hops( Client ) + 1, Client_MyToken( Client ), Client_Info( Client ))) return DISCONNECTED;
 					}
 					
-					/* Den neuen Server ueber den alten informieren */
-					if( ! IRC_WriteStrClientPrefix( Client, Client_Hops( c ) == 1 ? Client_ThisServer( ) : Client_Introducer( c ), "SERVER %s %d %d :%s", Client_ID( c ), Client_Hops( c ) + 1, Client_MyToken( c ), Client_Info( c ))) return DISCONNECTED;
+					/* Inform the new server about this one */
+					if (! IRC_WriteStrClientPrefix(Client,
+							Client_Hops(c) == 1 ? Client_ThisServer() : Client_TopServer(c),
+							"SERVER %s %d %d :%s",
+							Client_ID(c), Client_Hops(c) + 1,
+							Client_MyToken(c), Client_Info(c)))
+						return DISCONNECTED;
 				}
 				c = Client_Next( c );
 			}
