mirror of
https://github.com/osmarks/ngircd.git
synced 2025-10-22 01:47:37 +00:00
IRC_JOIN(): Code cleanup
This commit is contained in:
@@ -301,9 +301,9 @@ join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan,
|
|||||||
*
|
*
|
||||||
* See RFC 2812, 3.2.1 "Join message"; RFC 2813, 4.2.1 "Join message".
|
* See RFC 2812, 3.2.1 "Join message"; RFC 2813, 4.2.1 "Join message".
|
||||||
*
|
*
|
||||||
* @param Client The client from which this command has been received
|
* @param Client The client from which this command has been received
|
||||||
* @param Req Request structure with prefix and all parameters
|
* @param Req Request structure with prefix and all parameters
|
||||||
* @returns CONNECTED or DISCONNECTED
|
* @returns CONNECTED or DISCONNECTED
|
||||||
*/
|
*/
|
||||||
GLOBAL bool
|
GLOBAL bool
|
||||||
IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
||||||
@@ -312,8 +312,8 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
CLIENT *target;
|
CLIENT *target;
|
||||||
CHANNEL *chan;
|
CHANNEL *chan;
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert (Client != NULL);
|
||||||
assert( Req != NULL );
|
assert (Req != NULL);
|
||||||
|
|
||||||
/* Bad number of arguments? */
|
/* Bad number of arguments? */
|
||||||
if (Req->argc < 1 || Req->argc > 2)
|
if (Req->argc < 1 || Req->argc > 2)
|
||||||
@@ -327,7 +327,8 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
target = Client;
|
target = Client;
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix);
|
return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
|
||||||
|
Client_ID(Client), Req->prefix);
|
||||||
|
|
||||||
/* Is argument "0"? */
|
/* Is argument "0"? */
|
||||||
if (Req->argc == 1 && !strncmp("0", Req->argv[0], 2))
|
if (Req->argc == 1 && !strncmp("0", Req->argv[0], 2))
|
||||||
@@ -359,8 +360,9 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req )
|
|||||||
|
|
||||||
chan = Channel_Search(channame);
|
chan = Channel_Search(channame);
|
||||||
if (!chan && Conf_PredefChannelsOnly) {
|
if (!chan && Conf_PredefChannelsOnly) {
|
||||||
/* channel must be created, but server does not allow this */
|
/* channel must be created, but forbidden by config */
|
||||||
IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG, Client_ID(Client), channame);
|
IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG,
|
||||||
|
Client_ID(Client), channame);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user