- alle Client_GetFromID() durch Client_Search() ersetzt.

This commit is contained in:
Alexander Barton 2002-03-25 17:08:54 +00:00
parent c74083645a
commit bc4ed22635
4 changed files with 19 additions and 19 deletions

View File

@ -9,7 +9,7 @@
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
* $Id: irc-channel.c,v 1.2 2002/03/12 14:37:52 alex Exp $
* $Id: irc-channel.c,v 1.3 2002/03/25 17:08:54 alex Exp $
*
* irc-channel.c: IRC-Channel-Befehle
*/
@ -47,7 +47,7 @@ GLOBAL BOOLEAN IRC_JOIN( CLIENT *Client, REQUEST *Req )
if(( Req->argc > 1 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Wer ist der Absender? */
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_GetFromID( Req->prefix );
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix );
else target = Client;
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
@ -144,7 +144,7 @@ GLOBAL BOOLEAN IRC_PART( CLIENT *Client, REQUEST *Req )
if(( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Wer ist der Absender? */
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_GetFromID( Req->prefix );
if( Client_Type( Client ) == CLIENT_SERVER ) target = Client_Search( Req->prefix );
else target = Client;
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
@ -180,7 +180,7 @@ GLOBAL BOOLEAN IRC_TOPIC( CLIENT *Client, REQUEST *Req )
/* Falsche Anzahl Parameter? */
if(( Req->argc < 1 ) || ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_GetFromID( Req->prefix );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );

View File

@ -9,7 +9,7 @@
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
* $Id: irc-login.c,v 1.9 2002/03/19 16:38:37 alex Exp $
* $Id: irc-login.c,v 1.10 2002/03/25 17:10:49 alex Exp $
*
* irc-login.c: Anmeldung und Abmeldung im IRC
*/
@ -100,7 +100,7 @@ GLOBAL BOOLEAN IRC_NICK( CLIENT *Client, REQUEST *Req )
/* "Ziel-Client" ermitteln */
if( Client_Type( Client ) == CLIENT_SERVER )
{
target = Client_GetFromID( Req->prefix );
target = Client_Search( Req->prefix );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
}
else
@ -162,7 +162,7 @@ GLOBAL BOOLEAN IRC_NICK( CLIENT *Client, REQUEST *Req )
if( Req->argc != 7 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
/* Nick ueberpruefen */
c = Client_GetFromID( Req->argv[0] );
c = Client_Search( Req->argv[0] );
if( c )
{
/* Der neue Nick ist auf diesem Server bereits registriert:
@ -298,12 +298,12 @@ GLOBAL BOOLEAN IRC_PING( CLIENT *Client, REQUEST *Req )
if( Req->argc > 1 )
{
/* es wurde ein Ziel-Client angegeben */
target = Client_GetFromID( Req->argv[1] );
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
/* ok, forwarden */
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_GetFromID( Req->prefix );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
return IRC_WriteStrClientPrefix( target, from, "PING %s :%s", Client_ID( from ), Req->argv[1] );
@ -331,12 +331,12 @@ GLOBAL BOOLEAN IRC_PONG( CLIENT *Client, REQUEST *Req )
/* forwarden? */
if( Req->argc == 2 )
{
target = Client_GetFromID( Req->argv[1] );
target = Client_Search( Req->argv[1] );
if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->argv[1] );
if( target != Client_ThisServer( ))
{
/* ok, forwarden */
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_GetFromID( Req->prefix );
if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
else from = Client;
if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
return IRC_WriteStrClientPrefix( target, from, "PONG %s :%s", Client_ID( from ), Req->argv[1] );
@ -398,7 +398,7 @@ LOCAL VOID Kill_Nick( CHAR *Nick, CHAR *Reason )
IRC_WriteStrServers( NULL, "KILL %s :%s", Nick, Reason );
/* Ggf. einen eigenen Client toeten */
c = Client_GetFromID( Nick );
c = Client_Search( Nick );
if( c && ( Client_Conn( c ) != NONE )) Conn_Close( Client_Conn( c ), NULL, Reason, TRUE );
} /* Kill_Nick */

View File

@ -9,7 +9,7 @@
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
* $Id: irc-server.c,v 1.6 2002/03/12 14:37:52 alex Exp $
* $Id: irc-server.c,v 1.7 2002/03/25 17:12:22 alex Exp $
*
* irc-server.c: IRC-Befehle fuer Server-Links
*/
@ -200,7 +200,7 @@ GLOBAL BOOLEAN IRC_SERVER( CLIENT *Client, REQUEST *Req )
ptr = strchr( Req->argv[3] + 2, '[' );
if( ! ptr ) ptr = Req->argv[3];
from = Client_GetFromID( Req->prefix );
from = Client_Search( Req->prefix );
if( ! from )
{
/* Hm, Server, der diesen einfuehrt, ist nicht bekannt!? */
@ -262,7 +262,7 @@ GLOBAL BOOLEAN IRC_NJOIN( CLIENT *Client, REQUEST *Req )
ptr++;
}
c = Client_GetFromID( ptr );
c = Client_Search( ptr );
if( c )
{
Channel_Join( c, channame );
@ -315,7 +315,7 @@ GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
/* SQUIT an alle Server weiterleiten */
IRC_WriteStrServers( Client, "SQUIT %s :%s", Req->argv[0], Req->argv[1] );
target = Client_GetFromID( Req->argv[0] );
target = Client_Search( Req->argv[0] );
if( ! target )
{
/* Den Server kennen wir nicht (mehr), also nichts zu tun. */

View File

@ -9,7 +9,7 @@
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
* $Id: parse.c,v 1.30 2002/03/12 14:37:52 alex Exp $
* $Id: parse.c,v 1.31 2002/03/25 17:13:46 alex Exp $
*
* parse.c: Parsen der Client-Anfragen
*/
@ -224,7 +224,7 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
/* Befehl ist ein Statuscode */
/* Zielserver ermitteln */
if(( Client_Type( client ) == CLIENT_SERVER ) && ( Req->argc > 0 )) target = Client_GetFromID( Req->argv[0] );
if(( Client_Type( client ) == CLIENT_SERVER ) && ( Req->argc > 0 )) target = Client_Search( Req->argv[0] );
else target = NULL;
if( ! target )
{
@ -244,7 +244,7 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req )
Log( LOG_WARNING, "Got status code without prefix!?" );
return TRUE;
}
else prefix = Client_GetFromID( Req->prefix );
else prefix = Client_Search( Req->prefix );
if( ! prefix )
{
Log( LOG_WARNING, "Got status code from unknown source: \"%s\"", Req->prefix );