- /* User aus Channel entfernen */
- if( ! Remove_Client( REMOVE_PART, chan, Client, Origin, Reason, true)) return false;
- else return true;
+ /* Check that the client is in the channel */
+ if (!Get_Cl2Chan(chan, Client)) {
+ IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG,
+ Client_ID(Client), Name);
+ return false;
+ }
+
+ /* Part client from channel */
+ if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
+ return false;
+ else
+ return true;