commit - 67295c48ca10d60c7bc254b3e4b6a076a10dd592
commit + 6817e293c5c9f4b39a77af3333d835775e0c5462
blob - 4859623b9e9eea6fbfafcfcc170adde0231b0a08
blob + 078376d502670c88142c6467a7255930ad25a601
--- src/ngircd/irc.c
+++ src/ngircd/irc.c
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: irc.c,v 1.67 2002/02/25 13:21:25 alex Exp $
+ * $Id: irc.c,v 1.68 2002/02/25 17:46:27 alex Exp $
*
* irc.c: IRC-Befehle
*
* $Log: irc.c,v $
+ * Revision 1.68 2002/02/25 17:46:27 alex
+ * - an User wird nun immer ein "komplettes" Prefix verschickt.
+ *
* Revision 1.67 2002/02/25 13:21:25 alex
* - WHOIS wird nicht mehr automatisch an den "Original-Server" weiterge-
* leitet: war eh nicht RFC-konform und machte Probleme mit Clients.
LOCAL BOOLEAN Send_NAMES( CLIENT *Client, CHANNEL *Chan );
LOCAL BOOLEAN Send_LUSERS( CLIENT *Client );
+
+CHAR *Get_Prefix( CLIENT *Target, CLIENT *Client );
GLOBAL VOID IRC_Init( VOID )
vsnprintf( buffer, 1000, Format, ap );
va_end( ap );
- return Conn_WriteStr( Client_Conn( Client_NextHop( Client )), ":%s %s", Client_ID( Prefix ), buffer );
+ return Conn_WriteStr( Client_Conn( Client_NextHop( Client )), ":%s %s", Get_Prefix( Client_NextHop( Client ), Prefix ), buffer );
} /* IRC_WriteStrClientPrefix */
GLOBAL BOOLEAN IRC_WriteStrChannelPrefix( CLIENT *Client, CHANNEL *Chan, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
{
+ BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED;
CHAR buffer[1000];
- BOOLEAN sock[MAX_CONNECTIONS], ok = CONNECTED;
CL2CHAN *cl2chan;
CLIENT *c;
INT s, i;
assert( s >= 0 );
assert( s < MAX_CONNECTIONS );
sock[s] = TRUE;
+ if( Client_Type( c ) == CLIENT_SERVER ) is_server[s] = TRUE;
+ else is_server[s] = FALSE;
}
cl2chan = Channel_NextMember( Chan, cl2chan );
}
{
if( sock[i] )
{
- ok = Conn_WriteStr( i, ":%s %s", Client_ID( Prefix ), buffer );
+ if( is_server[i] ) ok = Conn_WriteStr( i, ":%s %s", Client_ID( Prefix ), buffer );
+ else ok = Conn_WriteStr( i, ":%s %s", Client_Mask( Prefix ), buffer );
if( ! ok ) break;
}
}
GLOBAL BOOLEAN IRC_WriteStrRelatedPrefix( CLIENT *Client, CLIENT *Prefix, BOOLEAN Remote, CHAR *Format, ... )
{
- BOOLEAN sock[MAX_CONNECTIONS], ok = CONNECTED;
+ BOOLEAN sock[MAX_CONNECTIONS], is_server[MAX_CONNECTIONS], ok = CONNECTED;
CL2CHAN *chan_cl2chan, *cl2chan;
CHAR buffer[1000];
CHANNEL *chan;
assert( s >= 0 );
assert( s < MAX_CONNECTIONS );
sock[s] = TRUE;
+ if( Client_Type( c ) == CLIENT_SERVER ) is_server[s] = TRUE;
+ else is_server[s] = FALSE;
}
cl2chan = Channel_NextMember( chan, cl2chan );
}
{
if( sock[i] )
{
- ok = Conn_WriteStr( i, ":%s %s", Client_ID( Prefix ), buffer );
+ if( is_server[i] ) ok = Conn_WriteStr( i, ":%s %s", Client_ID( Prefix ), buffer );
+ else ok = Conn_WriteStr( i, ":%s %s", Client_Mask( Prefix ), buffer );
if( ! ok ) break;
}
}
return CONNECTED;
} /* Send_LUSERS */
+
+
+CHAR *Get_Prefix( CLIENT *Target, CLIENT *Client )
+{
+ assert( Target != NULL );
+ assert( Client != NULL );
+ if( Client_Type( Target ) == CLIENT_SERVER ) return Client_ID( Client );
+ else return Client_Mask( Client );
+} /* Get_Prefix */
+
/* -eof- */