+GLOBAL BOOLEAN IRC_NICK( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *intr_c, *target, *c;
+ CHAR *modes;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ /* Zumindest BitchX sendet NICK-USER in der falschen Reihenfolge. */
+#ifndef STRICT_RFC
+ if( Client_Type( Client ) == CLIENT_UNKNOWN || Client_Type( Client ) == CLIENT_GOTPASS || Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTUSER || Client_Type( Client ) == CLIENT_USER || ( Client_Type( Client ) == CLIENT_SERVER && Req->argc == 1 ))
+#else
+ if( Client_Type( Client ) == CLIENT_UNKNOWN || Client_Type( Client ) == CLIENT_GOTPASS || Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_USER || ( Client_Type( Client ) == CLIENT_SERVER && Req->argc == 1 ))
+#endif
+ {
+ /* User-Registrierung bzw. Nick-Aenderung */
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* "Ziel-Client" ermitteln */
+ if( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ target = Client_GetFromID( Req->prefix );
+ if( ! target ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
+ }
+ else
+ {
+ /* Ist der Client "restricted"? */
+ if( Client_HasMode( Client, 'r' )) return IRC_WriteStrClient( Client, ERR_RESTRICTED_MSG, Client_ID( Client ));
+ target = Client;
+ }
+
+#ifndef STRICT_RFC
+ /* Wenn der Client zu seinem eigenen Nick wechseln will, so machen
+ * wir nichts. So macht es das Original und mind. Snak hat probleme,
+ * wenn wir es nicht so machen. Ob es so okay ist? Hm ... */
+ if( strcmp( Client_ID( target ), Req->argv[0] ) == 0 ) return CONNECTED;
+#endif
+
+ /* pruefen, ob Nick bereits vergeben. Speziallfall: der Client
+ * will nur die Gross- und Kleinschreibung aendern. Das darf
+ * er natuerlich machen :-) */
+ if( strcasecmp( Client_ID( target ), Req->argv[0] ) != 0 )
+ {
+ if( ! Client_CheckNick( target, Req->argv[0] )) return CONNECTED;
+ }
+
+ if( Client_Type( Client ) == CLIENT_USER )
+ {
+ /* Nick-Aenderung: allen mitteilen! */
+ Log( LOG_INFO, "User \"%s\" changed nick: \"%s\" -> \"%s\".", Client_Mask( target ), Client_ID( target ), Req->argv[0] );
+ IRC_WriteStrClient( Client, "NICK :%s", Req->argv[0] );
+ IRC_WriteStrServersPrefix( NULL, Client, "NICK :%s", Req->argv[0] );
+ }
+ else if( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ /* Nick-Aenderung: allen mitteilen! */
+ Log( LOG_DEBUG, "User \"%s\" changed nick: \"%s\" -> \"%s\".", Client_Mask( target ), Client_ID( target ), Req->argv[0] );
+ IRC_WriteStrServersPrefix( Client, target, "NICK :%s", Req->argv[0] );
+ }
+
+ /* Client-Nick registrieren */
+ Client_SetID( target, Req->argv[0] );
+
+ if(( Client_Type( target ) != CLIENT_USER ) && ( Client_Type( target ) != CLIENT_SERVER ))
+ {
+ /* Neuer Client */
+ Log( LOG_DEBUG, "Connection %d: got NICK command ...", Client_Conn( Client ));
+ if( Client_Type( Client ) == CLIENT_GOTUSER ) return Hello_User( Client );
+ else Client_SetType( Client, CLIENT_GOTNICK );
+ }
+ return CONNECTED;
+ }
+ else if( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ /* Server fuehrt neuen Client ein */
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 7 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* Nick ueberpruefen */
+ c = Client_GetFromID( Req->argv[0] );
+ if( c )
+ {
+ /* Der neue Nick ist auf diesem Server bereits registriert:
+ * sowohl der neue, als auch der alte Client muessen nun
+ * disconnectiert werden. */
+ Log( LOG_ERR, "Server %s introduces already registered nick \"%s\"!", Client_ID( Client ), Req->argv[0] );
+ Kill_Nick( Req->argv[0] );
+ return CONNECTED;
+ }
+
+ /* Server, zu dem der Client connectiert ist, suchen */
+ intr_c = Client_GetFromToken( Client, atoi( Req->argv[4] ));
+ if( ! intr_c )
+ {
+ Log( LOG_ERR, "Server %s introduces nick \"%s\" on unknown server!?", Client_ID( Client ), Req->argv[0] );
+ Kill_Nick( Req->argv[0] );
+ return CONNECTED;
+ }
+
+ /* Neue Client-Struktur anlegen */
+ c = Client_NewRemoteUser( intr_c, Req->argv[0], atoi( Req->argv[1] ), Req->argv[2], Req->argv[3], atoi( Req->argv[4] ), Req->argv[5] + 1, Req->argv[6], TRUE );
+ if( ! c )
+ {
+ /* Eine neue Client-Struktur konnte nicht angelegt werden.
+ * Der Client muss disconnectiert werden, damit der Netz-
+ * status konsistent bleibt. */
+ Log( LOG_ALERT, "Can't create client structure! (on connection %d)", Client_Conn( Client ));
+ Kill_Nick( Req->argv[0] );
+ return CONNECTED;
+ }
+
+ modes = Client_Modes( c );
+ 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] );
+
+ return CONNECTED;
+ }
+ else return IRC_WriteStrClient( Client, ERR_ALREADYREGISTRED_MSG, Client_ID( Client ));
+} /* IRC_NICK */
+
+
+GLOBAL BOOLEAN IRC_USER( CLIENT *Client, REQUEST *Req )
+{
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+#ifndef STRICT_RFC
+ if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS || Client_Type( Client ) == CLIENT_UNKNOWN )
+#else
+ if( Client_Type( Client ) == CLIENT_GOTNICK || Client_Type( Client ) == CLIENT_GOTPASS )
+#endif
+ {
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 4 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ Client_SetUser( Client, Req->argv[0], FALSE );
+ Client_SetInfo( Client, Req->argv[3] );
+
+ Log( LOG_DEBUG, "Connection %d: got USER command ...", Client_Conn( Client ));
+ if( Client_Type( Client ) == CLIENT_GOTNICK ) return Hello_User( Client );
+ else Client_SetType( Client, CLIENT_GOTUSER );
+ return CONNECTED;
+ }
+ else if( Client_Type( Client ) == CLIENT_USER || Client_Type( Client ) == CLIENT_SERVER || Client_Type( Client ) == CLIENT_SERVICE )
+ {
+ return IRC_WriteStrClient( Client, ERR_ALREADYREGISTRED_MSG, Client_ID( Client ));
+ }
+ else return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+} /* IRC_USER */
+
+
+GLOBAL BOOLEAN IRC_QUIT( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if(( Client_Type( Client ) == CLIENT_USER ) || ( Client_Type( Client ) == CLIENT_SERVICE ))
+ {
+ /* User / Service */
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ if( Req->argc == 0 ) Conn_Close( Client_Conn( Client ), "Got QUIT command.", NULL, TRUE );
+ else Conn_Close( Client_Conn( Client ), "Got QUIT command.", Req->argv[0], TRUE );
+
+ return DISCONNECTED;
+ }
+ else if ( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ /* Server */
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ target = Client_Search( Req->prefix );
+ if( ! target )
+ {
+ Log( LOG_ERR, "Got QUIT from %s for unknown client!?", Client_ID( Client ));
+ return CONNECTED;
+ }
+
+ if( Req->argc == 0 ) Client_Destroy( target, "Got QUIT command.", NULL );
+ else Client_Destroy( target, "Got QUIT command.", Req->argv[0] );
+
+ return CONNECTED;
+ }
+ else return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+} /* IRC_QUIT */
+
+
+GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ /* SQUIT ist nur fuer Server erlaubt */
+ if( Client_Type( Client ) != CLIENT_SERVER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ target = Client_GetFromID( Req->argv[0] );
+ if( ! target )
+ {
+ Log( LOG_ERR, "Got SQUIT from %s for unknown server \%s\"!?", Client_ID( Client ), Req->argv[0] );
+ return CONNECTED;
+ }
+
+ if( target == Client ) Log( LOG_DEBUG, "Got SQUIT from %s: %s", Client_ID( Client ), Req->argv[1] );
+ else Log( LOG_DEBUG, "Got SQUIT from %s for %s: %s", Client_ID( Client ), Client_ID( target ), Req->argv[1] );
+
+ /* SQUIT an alle Server weiterleiten */
+ IRC_WriteStrServers( Client, "SQUIT %s :%s", Req->argv[0], Req->argv[1] );
+
+ if( Client_Conn( target ) > NONE )
+ {
+ if( Req->argv[1][0] ) Conn_Close( Client_Conn( target ), "Got SQUIT command.", Req->argv[1], TRUE );
+ else Conn_Close( Client_Conn( target ), "Got SQUIT command.", NULL, TRUE );
+ return DISCONNECTED;
+ }
+ else
+ {
+ Client_Destroy( target, "Got SQUIT command.", Req->argv[1] );
+ return CONNECTED;
+ }
+} /* IRC_SQUIT */
+
+
+GLOBAL BOOLEAN IRC_PING( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target, *from;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NOORIGIN_MSG, Client_ID( Client ));
+ if( Req->argc > 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ if( Req->argc == 2 )
+ {
+ /* es wurde ein Ziel-Client angegeben */
+ target = Client_GetFromID( 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 );
+ else from = Client;
+ if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
+ return IRC_WriteStrClientPrefix( Client_NextHop( target ), from, "PING %s :%s", Client_ID( from ), Req->argv[1] );
+ }
+ }
+
+ Log( LOG_DEBUG, "Connection %d: got PING, sending PONG ...", Client_Conn( Client ));
+ return IRC_WriteStrClient( Client, "PONG %s :%s", Client_ID( Client_ThisServer( )), Client_ID( Client ));
+} /* IRC_PING */
+
+
+GLOBAL BOOLEAN IRC_PONG( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *target, *from;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NOORIGIN_MSG, Client_ID( Client ));
+ if( Req->argc > 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* forwarden? */
+ if( Req->argc == 2 )
+ {
+ target = Client_GetFromID( 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 );
+ else from = Client;
+ if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG, Client_ID( Client ), Req->prefix );
+ return IRC_WriteStrClientPrefix( Client_NextHop( target ), from, "PONG %s :%s", Client_ID( from ), Req->argv[1] );
+ }
+ }
+
+ /* Der Connection-Timestamp wurde schon beim Lesen aus dem Socket
+ * aktualisiert, daher muss das hier nicht mehr gemacht werden. */
+
+ if( Client_Conn( Client ) > NONE ) Log( LOG_DEBUG, "Connection %d: received PONG. Lag: %d seconds.", Client_Conn( Client ), time( NULL ) - Conn_LastPing( Client_Conn( Client )));
+ else Log( LOG_DEBUG, "Connection %d: received PONG.", Client_Conn( Client ));
+
+ return CONNECTED;
+} /* IRC_PONG */
+
+
+GLOBAL BOOLEAN IRC_MOTD( CLIENT *Client, REQUEST *Req )
+{
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if( Client_Type( Client ) != CLIENT_USER ) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 0 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ return Show_MOTD( Client );
+} /* IRC_MOTD */
+
+
+GLOBAL BOOLEAN IRC_PRIVMSG( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *to, *from;
+ CHANNEL *chan;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc == 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
+ if( Req->argc == 1 ) return IRC_WriteStrClient( Client, ERR_NOTEXTTOSEND_MSG, Client_ID( Client ));
+ if( 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 );
+ else from = Client;
+ if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
+
+ to = Client_Search( Req->argv[0] );
+ if( to )
+ {
+ /* Okay, Ziel ist ein User */
+ if( Client_Conn( from ) > NONE ) Conn_UpdateIdle( Client_Conn( from ));
+ return IRC_WriteStrClientPrefix( to, from, "PRIVMSG %s :%s", Client_ID( to ), Req->argv[1] );
+ }
+
+ chan = Channel_Search( Req->argv[0] );
+ if( chan )
+ {
+ /* Okay, Ziel ist ein Channel */
+ if( Client_Conn( from ) > NONE ) Conn_UpdateIdle( Client_Conn( from ));
+ return IRC_WriteStrChannelPrefix( Client, chan, from, TRUE, "PRIVMSG %s :%s", Req->argv[0], Req->argv[1] );
+ }
+
+ return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( from ), Req->argv[0] );
+} /* IRC_PRIVMSG */
+
+
+GLOBAL BOOLEAN IRC_NOTICE( CLIENT *Client, REQUEST *Req )
+{
+ CLIENT *to, *from;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Falsche Anzahl Parameter? */
+ if( Req->argc != 2 ) return CONNECTED;
+
+ if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_GetFromID( Req->prefix );
+ else from = Client;
+ if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
+
+ to = Client_Search( Req->argv[0] );
+ if( to )
+ {
+ /* Okay, Ziel ist ein User */
+ return IRC_WriteStrClientPrefix( to, from, "NOTICE %s :%s", Client_ID( to ), Req->argv[1] );
+ }
+ else return CONNECTED;
+} /* IRC_NOTICE */
+
+
+GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
+{
+ CHAR *mode_ptr, the_modes[CLIENT_MODE_LEN], x[2];
+ CLIENT *cl, *chan_cl, *prefix;
+ BOOLEAN set, ok;
+ CHANNEL *chan;
+
+ assert( Client != NULL );
+ assert( Req != NULL );
+
+ cl = chan_cl = prefix = NULL;
+ chan = NULL;
+
+ /* Valider Client? */
+ if(( Client_Type( Client ) != CLIENT_USER ) && ( Client_Type( Client ) != CLIENT_SERVER )) return IRC_WriteStrClient( Client, ERR_NOTREGISTERED_MSG, Client_ID( Client ));
+
+ /* Keine Parameter? */
+ if( Req->argc < 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* Ziel suchen: Client bzw. Channel */
+ if( Client_IsValidNick( Req->argv[0] )) cl = Client_Search( Req->argv[0] );
+ if( Channel_IsValidName( Req->argv[0] )) chan = Channel_Search( Req->argv[0] );
+
+ /* Kein Ziel gefunden? */
+ if(( ! cl ) && ( ! chan )) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
+
+ assert(( cl && chan ) != TRUE );
+
+ /* Falsche Anzahl Parameter? */
+ if(( cl ) && ( Req->argc > 2 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+ if(( chan ) && ( Req->argc > 3 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+
+ /* Client ermitteln, wenn bei Channel-Modes mit 3 Parametern */
+ if(( chan ) && (Req->argc == 3 ))
+ {
+ chan_cl = Client_Search( Req->argv[2] );
+ if( ! chan_cl ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->argv[0] );
+ }
+
+ /* Wenn Anfragender ein User ist: Zugriff erlaubt? */
+ if( Client_Type( Client ) == CLIENT_USER )
+ {
+ if( cl )
+ {
+ /* MODE ist nur fuer sich selber zulaessig! */
+ if( cl != Client ) return IRC_WriteStrClient( Client, ERR_USERSDONTMATCH_MSG, Client_ID( Client ));
+ }
+ if( chan )
+ {
+ /* Darf der User die Channel-Modes ermitteln? */
+ }
+ }
+
+ /* Werden die Modes "nur" erfragt? */
+ if(( cl ) && ( Req->argc == 1 )) return IRC_WriteStrClient( Client, RPL_UMODEIS_MSG, Client_ID( Client ), Client_Modes( cl ));
+ if(( chan ) && ( Req->argc == 1 )) return IRC_WriteStrClient( Client, RPL_CHANNELMODEIS_MSG, Client_ID( Client ), Channel_Name( chan ), Channel_Modes( chan ));
+
+ mode_ptr = Req->argv[1];
+
+ /* Sollen Modes gesetzt oder geloescht werden? */
+ if( cl )
+ {
+ if( *mode_ptr == '+' ) set = TRUE;
+ else if( *mode_ptr == '-' ) set = FALSE;
+ else return IRC_WriteStrClient( Client, ERR_UMODEUNKNOWNFLAG_MSG, Client_ID( Client ));
+ mode_ptr++;
+ }
+ else
+ {
+ if( *mode_ptr == '-' ) set = FALSE;
+ else set = TRUE;
+ if(( *mode_ptr == '-' ) || ( *mode_ptr == '+' )) mode_ptr++;
+ }
+
+ /* Prefix fuer Antworten etc. ermitteln */
+ if( Client_Type( Client ) == CLIENT_SERVER )
+ {
+ prefix = Client_GetFromID( Req->prefix );
+ if( ! prefix ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
+ }
+ else prefix = Client;
+
+ /* Reply-String mit Aenderungen vorbereiten */
+ if( set ) strcpy( the_modes, "+" );
+ else strcpy( the_modes, "-" );
+