channel: Move flood_attack_channel() to a boolean

This commit is contained in:
Matt Ullman 2016-03-24 02:19:30 -04:00
parent 216f58a27c
commit 3b9507d0e9
2 changed files with 6 additions and 6 deletions

View file

@ -213,7 +213,7 @@ extern void destroy_channel(struct Channel *);
extern int can_send(struct Channel *chptr, struct Client *who, extern int can_send(struct Channel *chptr, struct Client *who,
struct membership *); struct membership *);
extern int flood_attack_channel(int p_or_n, struct Client *source_p, extern bool flood_attack_channel(int p_or_n, struct Client *source_p,
struct Channel *chptr, char *chname); struct Channel *chptr, char *chname);
extern int is_banned(struct Channel *chptr, struct Client *who, extern int is_banned(struct Channel *chptr, struct Client *who,
struct membership *msptr, const char *, const char *, const char **); struct membership *msptr, const char *, const char *, const char **);

View file

@ -901,11 +901,11 @@ can_send(struct Channel *chptr, struct Client *source_p, struct membership *mspt
* inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC * inputs - flag 0 if PRIVMSG 1 if NOTICE. RFC
* says NOTICE must not auto reply * says NOTICE must not auto reply
* - pointer to source Client * - pointer to source Client
* - pointer to target channel * - pointer to target channel
* output - 1 if target is under flood attack * output - true if target is under flood attack
* side effects - check for flood attack on target chptr * side effects - check for flood attack on target chptr
*/ */
int bool
flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, char *chname) flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, char *chname)
{ {
int delta; int delta;
@ -943,13 +943,13 @@ flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr,
sendto_one(source_p, sendto_one(source_p,
":%s NOTICE %s :*** Message to %s throttled due to flooding", ":%s NOTICE %s :*** Message to %s throttled due to flooding",
me.name, source_p->name, chptr->chname); me.name, source_p->name, chptr->chname);
return 1; return true;
} }
else else
chptr->received_number_of_privmsgs++; chptr->received_number_of_privmsgs++;
} }
return 0; return false;
} }
/* find_bannickchange_channel() /* find_bannickchange_channel()