mirror of
https://github.com/osmarks/ngircd.git
synced 2024-12-12 09:50:29 +00:00
Channel_Join(): Code cleanup.
This commit is contained in:
parent
e37080400b
commit
477f2fd9e7
@ -183,30 +183,34 @@ Channel_Join( CLIENT *Client, char *Name )
|
|||||||
{
|
{
|
||||||
CHANNEL *chan;
|
CHANNEL *chan;
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert(Client != NULL);
|
||||||
assert( Name != NULL );
|
assert(Name != NULL);
|
||||||
|
|
||||||
/* Check that the channel name is valid */
|
/* Check that the channel name is valid */
|
||||||
if( ! Channel_IsValidName( Name )) {
|
if (! Channel_IsValidName(Name)) {
|
||||||
IRC_WriteStrClient( Client, ERR_NOSUCHCHANNEL_MSG, Client_ID( Client ), Name );
|
IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG,
|
||||||
|
Client_ID(Client), Name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
chan = Channel_Search( Name );
|
chan = Channel_Search(Name);
|
||||||
if( chan ) {
|
if(chan) {
|
||||||
/* Check if the client is already in the channel */
|
/* Check if the client is already in the channel */
|
||||||
if( Get_Cl2Chan( chan, Client )) return false;
|
if (Get_Cl2Chan(chan, Client))
|
||||||
}
|
return false;
|
||||||
else
|
} else {
|
||||||
{
|
/* If the specified channel does not exist, the channel
|
||||||
/* If the specified channel doesn't exist, the channel is created */
|
* is now created */
|
||||||
chan = Channel_Create( Name );
|
chan = Channel_Create(Name);
|
||||||
if (!chan) return false;
|
if (!chan)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add user to Channel */
|
/* Add user to Channel */
|
||||||
if( ! Add_Client( chan, Client )) return false;
|
if (! Add_Client(chan, Client))
|
||||||
else return true;
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
} /* Channel_Join */
|
} /* Channel_Join */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user