diff options
| author | Alexander Barton <alex@barton.de> | 2013-09-07 00:05:49 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2013-09-07 00:05:49 +0200 |
| commit | 131364def157263d1416e559636593a4daaca72a (patch) | |
| tree | e94ed80f7a153b3ec4d6d14494adea2c8a6edbad | |
| parent | bcb45da1b416e7ee4b50dcf16947fb9703f713cf (diff) | |
| download | ngircd-131364def157263d1416e559636593a4daaca72a.tar.gz ngircd-131364def157263d1416e559636593a4daaca72a.zip | |
IRC_SetPenalty(): Code cleanup
| -rw-r--r-- | src/ngircd/irc-write.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index 526e2fb6..25cecaff 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -538,24 +538,27 @@ va_dcl /** * 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 Seconds The additional "penalty time" to enforce. */ GLOBAL void -IRC_SetPenalty( CLIENT *Client, time_t Seconds ) +IRC_SetPenalty(CLIENT *Client, time_t Seconds) { CONN_ID c; - assert( Client != NULL ); - assert( Seconds > 0 ); + assert(Client != NULL); + assert(Seconds > 0); + + if (Client_Type(Client) == CLIENT_SERVER) + return; - if( Client_Type( Client ) == CLIENT_SERVER ) return; + c = Client_Conn(Client); + if (c <= NONE) + return; - c = Client_Conn( Client ); - if (c > NONE) - Conn_SetPenalty(c, Seconds); + Conn_SetPenalty(c, Seconds); } /* IRC_SetPenalty */ static const char * |