From 3b9507d0e973da824335f01384aac8d367229969 Mon Sep 17 00:00:00 2001 From: Matt Ullman Date: Thu, 24 Mar 2016 02:19:30 -0400 Subject: [PATCH] channel: Move flood_attack_channel() to a boolean --- include/channel.h | 2 +- ircd/channel.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/channel.h b/include/channel.h index 5c266e911..a25f191e0 100644 --- a/include/channel.h +++ b/include/channel.h @@ -213,7 +213,7 @@ extern void destroy_channel(struct Channel *); extern int can_send(struct Channel *chptr, struct Client *who, 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); extern int is_banned(struct Channel *chptr, struct Client *who, struct membership *msptr, const char *, const char *, const char **); diff --git a/ircd/channel.c b/ircd/channel.c index d4fe10e20..4609325ab 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -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 * says NOTICE must not auto reply * - pointer to source Client - * - pointer to target channel - * output - 1 if target is under flood attack + * - pointer to target channel + * output - true if target is under flood attack * 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) { int delta; @@ -943,13 +943,13 @@ flood_attack_channel(int p_or_n, struct Client *source_p, struct Channel *chptr, sendto_one(source_p, ":%s NOTICE %s :*** Message to %s throttled due to flooding", me.name, source_p->name, chptr->chname); - return 1; + return true; } else chptr->received_number_of_privmsgs++; } - return 0; + return false; } /* find_bannickchange_channel()