Channel_Part(): Code and comment cleanup.

This commit is contained in:
Alexander Barton 2008-04-24 23:47:33 +02:00
parent 25f48a2a34
commit 54b17fc201
1 changed files with 19 additions and 11 deletions

View File

@ -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 */