Browse Source

m_repeatprot: Renamed exemptions to exceptions cuz [[triggered]]

Wazakindjes 3 years ago
parent
commit
8e63740593
1 changed files with 20 additions and 20 deletions
  1. 20 20
      uncommon/m_repeatprot.c

+ 20 - 20
uncommon/m_repeatprot.c

@@ -21,11 +21,11 @@
 		} \
 	} while(0)
 
-typedef struct t_exemption muhExempt;
+typedef struct t_exception muhExcept;
 typedef struct t_msg muhMessage;
-struct t_exemption {
+struct t_exception {
 	char *mask;
-	muhExempt *next;
+	muhExcept *next;
 };
 struct t_msg {
 	char *last;
@@ -50,7 +50,7 @@ void repeatprot_free(ModData *md);
 static ModuleInfo *repeatprotMI = NULL; // Store ModuleInfo so we can use it to check for errors in MOD_LOAD
 Cmdoverride *inviteOvr, *operOvr, *noticeOvr, *privmsgOvr; // Pointers to the overrides we're gonna add
 ModDataInfo *repeatprotMDI; // To store every user's last message with their client pointer ;3
-muhExempt *exemptList = NULL; // Stores exempted masks
+muhExcept *exceptionList = NULL; // Stores exempted masks
 
 // Deez defaults
 int repeatThreshold = 3; // After how many repeated message the action kicks in
@@ -69,7 +69,7 @@ time_t trigTimespan = 0;
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_repeatprot) = {
 	"m_repeatprot", // Module name
-	"$Id: v1.26 2018/04/16 Gottem$", // Version
+	"$Id: v1.27 2018/11/04 Gottem$", // Version
 	"G(Z):Line/kill users (or block their messages) who spam through CTCP, INVITE, OPER, NOTICE and/or PRIVMSG", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -119,14 +119,14 @@ MOD_LOAD(m_repeatprot) {
 
 // Called on unload/rehash obv
 MOD_UNLOAD(m_repeatprot) {
-	if(exemptList) {
+	if(exceptionList) {
 		// This shit is a bit convoluted to prevent memory issues obv famalmalmalmlmalm
-		muhExempt *exEntry;
-		while((exEntry = exemptList) != NULL) {
-			exemptList = exemptList->next;
+		muhExcept *exEntry;
+		while((exEntry = exceptionList) != NULL) {
+			exceptionList = exceptionList->next;
 			free(exEntry);
 		}
-		exemptList = NULL;
+		exceptionList = NULL;
 	}
 	return MOD_SUCCESS; // We good
 }
@@ -237,18 +237,18 @@ int repeatprot_configtest(ConfigFile *cf, ConfigEntry *ce, int type, int *errs)
 			continue;
 		}
 
-		// Also dem exemptions
-		if(!strcmp(cep->ce_varname, "exemptions")) {
+		// Also dem exceptions
+		if(!strcmp(cep->ce_varname, "exceptions")) {
 			// Loop 'em
 			for(cep2 = cep->ce_entries; cep2; cep2 = cep2->ce_next) {
 				if(!cep2->ce_varname) {
-					config_error("%s:%i: blank exemption mask", cep2->ce_fileptr->cf_filename, cep2->ce_varlinenum); // Rep0t error
+					config_error("%s:%i: blank exception mask", cep2->ce_fileptr->cf_filename, cep2->ce_varlinenum); // Rep0t error
 					errors++; // Increment err0r count fam
 					continue; // Next iteration imo tbh
 				}
 
 				if(match("*!*@*", cep2->ce_varname)) {
-					config_error("%s:%i: invalid nick!user@host exemption mask", cep2->ce_fileptr->cf_filename, cep2->ce_varlinenum); // Rep0t error
+					config_error("%s:%i: invalid nick!user@host exception mask", cep2->ce_fileptr->cf_filename, cep2->ce_varlinenum); // Rep0t error
 					errors++; // Increment err0r count fam
 					continue; // Next iteration imo tbh
 				}
@@ -278,8 +278,8 @@ int repeatprot_configposttest(int *errs) {
 // "Run" the config (everything should be valid at this point)
 int repeatprot_configrun(ConfigFile *cf, ConfigEntry *ce, int type) {
 	ConfigEntry *cep, *cep2; // To store the current variable/value pair etc, nested
-	muhExempt *last = NULL; // Initialise to NULL so the loop requires minimal l0gic
-	muhExempt **exEntry = &exemptList; // Hecks so the ->next chain stays intact
+	muhExcept *last = NULL; // Initialise to NULL so the loop requires minimal l0gic
+	muhExcept **exEntry = &exceptionList; // Hecks so the ->next chain stays intact
 
 	// Since we'll add a top-level block to unrealircd.conf, need to filter on CONFIG_MAIN lmao
 	if(type != CONFIG_MAIN)
@@ -367,7 +367,7 @@ int repeatprot_configrun(ConfigFile *cf, ConfigEntry *ce, int type) {
 			continue;
 		}
 
-		if(!strcmp(cep->ce_varname, "exemptions")) {
+		if(!strcmp(cep->ce_varname, "exceptions")) {
 			// Loop 'em
 			for(cep2 = cep->ce_entries; cep2; cep2 = cep2->ce_next) {
 				if(!cep2->ce_varname)
@@ -377,7 +377,7 @@ int repeatprot_configrun(ConfigFile *cf, ConfigEntry *ce, int type) {
 				size_t masklen = sizeof(char) * (strlen(cep2->ce_varname) + 1);
 
 				// Allocate mem0ry for the current entry
-				*exEntry = malloc(sizeof(muhExempt));
+				*exEntry = malloc(sizeof(muhExcept));
 
 				// Allocate/initialise shit here
 				(*exEntry)->mask = malloc(masklen);
@@ -519,7 +519,7 @@ static int repeatprot_override(Cmdoverride *ovr, aClient *cptr, aClient *sptr, i
 	char *werd; // Store each w0rd from the message
 	aClient *acptr; // Store /message target
 	muhMessage *message; // Current/new message struct
-	muhExempt *exEntry; // For iteration yo
+	muhExcept *exEntry; // For iteration yo
 
 	// Lest we massively shit ourselves =]
 	if(!sptr || BadPtr(parv[1]) || BadPtr(parv[2]) || BadPtr(parv[parc - 1]))
@@ -538,7 +538,7 @@ static int repeatprot_override(Cmdoverride *ovr, aClient *cptr, aClient *sptr, i
 	ctcpreply = (!strcmp(cmd, "NOTICE") && ctcp);
 	invite = (!strcmp(cmd, "INVITE"));
 
-	for(exEntry = exemptList; exEntry; exEntry = exEntry->next) {
+	for(exEntry = exceptionList; exEntry; exEntry = exEntry->next) {
 		if(!match(exEntry->mask, make_nick_user_host(sptr->name, sptr->user->username, sptr->user->realhost)) || !match(exEntry->mask, make_nick_user_host(sptr->name, sptr->user->username, sptr->ip))) {
 			exempt = 1;
 			break;