mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-05 21:30:29 +00:00
IRC_HELP(): Code cleanup
This commit is contained in:
parent
9e1c25a889
commit
588af510a3
@ -304,25 +304,35 @@ IRC_TRACE( CLIENT *Client, REQUEST *Req )
|
|||||||
} /* IRC_TRACE */
|
} /* IRC_TRACE */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handler for the IRC "HELP" command.
|
||||||
|
*
|
||||||
|
* @param Client The client from which this command has been received.
|
||||||
|
* @param Req Request structure with prefix and all parameters.
|
||||||
|
* @return CONNECTED or DISCONNECTED.
|
||||||
|
*/
|
||||||
GLOBAL bool
|
GLOBAL bool
|
||||||
IRC_HELP( CLIENT *Client, REQUEST *Req )
|
IRC_HELP(CLIENT *Client, REQUEST *Req)
|
||||||
{
|
{
|
||||||
COMMAND *cmd;
|
COMMAND *cmd;
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert(Client != NULL);
|
||||||
assert( Req != NULL );
|
assert(Req != NULL);
|
||||||
|
|
||||||
/* Bad number of arguments? */
|
/* Bad number of arguments? */
|
||||||
if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
|
if (Req->argc > 0)
|
||||||
|
return IRC_WriteStrClient(Client, ERR_NORECIPIENT_MSG,
|
||||||
|
Client_ID(Client), Req->command);
|
||||||
|
|
||||||
cmd = Parse_GetCommandStruct( );
|
cmd = Parse_GetCommandStruct();
|
||||||
while( cmd->name )
|
while(cmd->name) {
|
||||||
{
|
if (!IRC_WriteStrClient(Client, "NOTICE %s :%s",
|
||||||
if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
|
Client_ID(Client), cmd->name))
|
||||||
|
return DISCONNECTED;
|
||||||
cmd++;
|
cmd++;
|
||||||
}
|
}
|
||||||
|
|
||||||
IRC_SetPenalty( Client, 2 );
|
IRC_SetPenalty(Client, 2);
|
||||||
return CONNECTED;
|
return CONNECTED;
|
||||||
} /* IRC_HELP */
|
} /* IRC_HELP */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user