Remove 'type' argument of flood_prot()

All callers of flood_prot() were supplying { get_flood_types(flood_type), flood_type } as the second and third arguments,
except one that supplied { get_flood_types(CTCP_FLOOD), CTCP_ACTION_FLOOD }.

Hardwiring this logic in to flood_prot() lets us remove the 'type' argument without changing the behaviour.
This commit is contained in:
Kevin Easton
2017-01-18 00:11:49 +11:00
parent 7dce90d809
commit 78dbdea441
4 changed files with 21 additions and 22 deletions

View File

@@ -7,10 +7,10 @@
#ifndef __flood_h_
#define __flood_h_
int BX_check_flooding (char *, int, char *, char *);
int BX_is_other_flood (ChannelList *, NickList *, int, int *);
int BX_flood_prot (char *, char *, char *, int, int, char *);
void clean_flood_list (void);
int BX_check_flooding(char *, int, char *, char *);
int BX_is_other_flood(ChannelList *, NickList *, int, int *);
int BX_flood_prot(char *nick, char *userhost, int flood_type, int ignoretime, char *channel);
void clean_flood_list(void);
#define MSG_FLOOD 0x0001
#define PUBLIC_FLOOD 0x0002

View File

@@ -596,7 +596,7 @@ extern Function_ptr *global;
/* flood.c */
#define is_other_flood (*(int (*)(ChannelList *, NickList *, int, int *))global[IS_OTHER_FLOOD])
#define check_flooding (*(int (*)(char *, int , char *, char *))global[CHECK_FLOODING])
#define flood_prot (*(int (*)(char *, char *, char *, int , int , char *))global[FLOOD_PROT])
#define flood_prot (*(int (*)(char *, char *, int , int , char *))global[FLOOD_PROT])
/* expr.c */
#define next_unit (*(char *(*)(char *, const char *, int *, int ))global[NEXT_UNIT])