- 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 );
-
- /* Ziel-User suchen */
- target = Client_Search( Req->argv[1] );
- if( ! target ) return IRC_WriteStrClient( from, ERR_NOSUCHNICK_MSG, Client_ID( from ), Req->argv[1] );
+ 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);
+
+ reason = Req->argc == 3 ? Req->argv[2] : Client_ID(from);
+ currentNick = Req->argv[1];
+ currentChannel = Req->argv[0];
+ if (channelCount == 1) {
+ while (nickCount > 0) {
+ if (!try_kick(Client, from, currentNick,
+ currentChannel, reason))
+ return false;
+
+ while (*currentNick)
+ currentNick++;
+
+ currentNick++;
+ nickCount--;
+ }
+ } else if (channelCount == nickCount) {
+ while (nickCount > 0) {
+ if (!try_kick(Client, from, currentNick,
+ currentChannel, reason))
+ return false;