IRC_SetPenalty(): Code cleanup

This commit is contained in:
Alexander Barton 2013-09-07 00:05:49 +02:00
parent bcb45da1b4
commit 131364def1
1 changed files with 11 additions and 8 deletions

View File

@ -538,24 +538,27 @@ va_dcl
/** /**
* Set a "penalty time" for an IRC client. * Set a "penalty time" for an IRC client.
* *
* Note: penalty times are never set for server links! * Note: penalty times are never set for server links or remote clients!
* *
* @param Client The client. * @param Client The client.
* @param Seconds The additional "penalty time" to enforce. * @param Seconds The additional "penalty time" to enforce.
*/ */
GLOBAL void GLOBAL void
IRC_SetPenalty( CLIENT *Client, time_t Seconds ) IRC_SetPenalty(CLIENT *Client, time_t Seconds)
{ {
CONN_ID c; CONN_ID c;
assert( Client != NULL ); assert(Client != NULL);
assert( Seconds > 0 ); assert(Seconds > 0);
if( Client_Type( Client ) == CLIENT_SERVER ) return; if (Client_Type(Client) == CLIENT_SERVER)
return;
c = Client_Conn( Client ); c = Client_Conn(Client);
if (c > NONE) if (c <= NONE)
Conn_SetPenalty(c, Seconds); return;
Conn_SetPenalty(c, Seconds);
} /* IRC_SetPenalty */ } /* IRC_SetPenalty */
static const char * static const char *