commit 54b17fc20162941d03a17ddf78706c5fdc5cfff4 from: Alexander Barton date: Thu Apr 24 21:47:33 2008 UTC Channel_Part(): Code and comment cleanup. commit - 25f48a2a342caf962920ee316b258812526f7a9d commit + 54b17fc20162941d03a17ddf78706c5fdc5cfff4 blob - 35922c2b13838bd3bf20fa25192b8b9628667dde blob + a4eca1f18425f0b79a05ef225f129544b1f1f75d --- src/ngircd/channel.c +++ src/ngircd/channel.c @@ -201,25 +201,33 @@ Channel_Join( CLIENT *Client, char *Name ) } /* Channel_Join */ +/** + * Remove client from channel. + * This function lets a client lead a channel. First, the function checks + * if the channel exists and the client is a member of it and sends out + * appropriate error messages if not. The real work is done by the function + * Remove_Client(). + */ GLOBAL bool -Channel_Part( CLIENT *Client, CLIENT *Origin, const char *Name, const char *Reason ) +Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Reason) { CHANNEL *chan; - assert( Client != NULL ); - assert( Name != NULL ); - assert( Reason != NULL ); + assert(Client != NULL); + assert(Name != NULL); + assert(Reason != NULL); - chan = Channel_Search( Name ); - if(( ! chan ) || ( ! Get_Cl2Chan( chan, Client ))) - { - IRC_WriteStrClient( Client, ERR_NOSUCHCHANNEL_MSG, Client_ID( Client ), Name ); + chan = Channel_Search(Name); + if ((!chan) || (!Get_Cl2Chan(chan, Client))) { + IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG, + Client_ID(Client), Name); return false; } - /* User aus Channel entfernen */ - if( ! Remove_Client( REMOVE_PART, chan, Client, Origin, Reason, true)) return false; - else return true; + if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true)) + return false; + else + return true; } /* Channel_Part */