commit - 6bc2d3d06e9cb4da68ea4b63d9b6b219d88ab927
commit + 4f759d811347a578624dde37462b9a056cca0720
blob - 82e3482a0916715e1c2614466f3f2ddfbe99d81c
blob + cfdf9d010fe3f924c63f5ce969c2f17ff5bbe255
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
static bool Hello_User PARAMS(( CLIENT *Client ));
static void Kill_Nick PARAMS(( char *Nick, char *Reason ));
+static void Introduce_Client PARAMS(( CLIENT *From, const char *Nick,
+ const int HopCount, const char *User,
+ const char *Host, const int Token,
+ const char *Mode, const char *Name ));
/**
if( *modes ) Log( LOG_DEBUG, "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": "" );
else Log( LOG_DEBUG, "User \"%s\" registered (via %s, on %s, %d hop%s).", Client_Mask( c ), Client_ID( Client ), Client_ID( intr_c ), Client_Hops( c ), Client_Hops( c ) > 1 ? "s": "" );
- /* Andere Server, ausser dem Introducer, informieren */
- IRC_WriteStrServersPrefix( Client, Client, "NICK %s %d %s %s %d %s :%s", Req->argv[0], atoi( Req->argv[1] ) + 1, Req->argv[2], Req->argv[3], Client_MyToken( intr_c ), Req->argv[5], Req->argv[6] );
+ /* Inform other servers about the new client */
+ Introduce_Client(Client, Req->argv[0], atoi(Req->argv[1]) + 1,
+ Req->argv[2], Req->argv[3],
+ Client_MyToken(intr_c), Req->argv[5],
+ Req->argv[6]);
return CONNECTED;
}
static bool
Hello_User(CLIENT * Client)
{
+ char modes[CLIENT_MODE_LEN + 1] = "+";
+
assert(Client != NULL);
/* Check password ... */
Client_Mask(Client), Client_Conn(Client));
/* Inform other servers */
- IRC_WriteStrServers(NULL, "NICK %s 1 %s %s 1 +%s :%s",
- Client_ID(Client), Client_User(Client),
- Client_Hostname(Client), Client_Modes(Client),
- Client_Info(Client));
+ strlcat(modes, Client_Modes(Client), sizeof(modes));
+ Introduce_Client(NULL, Client_ID(Client), 1, Client_User(Client),
+ Client_Hostname(Client), 1, modes, Client_Info(Client));
if (!IRC_WriteStrClient
(Client, RPL_WELCOME_MSG, Client_ID(Client), Client_Mask(Client)))
} /* Kill_Nick */
+static void
+Introduce_Client(CLIENT *From, const char *Nick, const int HopCount,
+const char *User, const char *Host, const int Token, const char *Mode,
+const char *Name)
+{
+ IRC_WriteStrServersPrefix(From,
+ From != NULL ? From : Client_ThisServer(),
+ "NICK %s %d %s %s %d %s :%s",
+ Nick, HopCount, User, Host, Token, Mode, Name);
+} /* Introduce_Client */
+
+
/* -eof- */