Browse Source

Apparently you don't need to do StripControlCodes(StripColors(text)), just contr0l c0dds is enough according to Syzop bae ;];]

Wazakindjes 3 years ago
parent
commit
9f9056a6fc
8 changed files with 22 additions and 19 deletions
  1. 1 1
      README.md
  2. 2 2
      malv/m_otkl.c
  3. 2 2
      u4/m_anti_amsg.c
  4. 2 2
      u4/m_anticaps.c
  5. 3 3
      u4/m_block_masshighlight.c
  6. 8 5
      u4/m_uniquemsg.c
  7. 2 2
      uncommon/m_repeatprot.c
  8. 2 2
      uncommon/m_textshun.c

+ 1 - 1
README.md

@@ -107,7 +107,7 @@ __Example output:__
 
 So in this case I ran the command on `someleaf`, which only has information about the hub it's linked to. For the other servers this leaf asks its hub for the information instead (otherwise we can't tell if it's using SSL or nah). The hub has info on 2 additional servers; another leaf and the services node.
 
-You can get similar information by using `/stats C`, but: 1) it only outputs shit for directly attached servers 2) it requires you to remove `C` from `set::oper-only-stats` for making it publicly usable 3) it displays the server connection port too ;]
+You can get similar information by using `/stats C`, but: 1) it only outputs shit for directly attached servers 2) it requires you to remove `C` from `set::oper-only-stats` for making it publicly usable 3) it displays the server connection port too. ;]
 
 # m_noghosts
 Originally proposed by `PeGaSuS`, this module makes IRC opers part `+O` channels once they oper down. I've kept the "ghosts" thing for lack of a better term, deal w/ it. =]

+ 2 - 2
malv/m_otkl.c

@@ -98,7 +98,7 @@ static char *muhHalp[] = {
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_otkl) = {
 	"m_otkl", // Module name
-	"$Id: v1.05 2017/11/22 Gottem$", // Version
+	"$Id: v1.06 2018/04/16 Gottem$", // Version
 	"Implements one-time TKLines", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -501,7 +501,7 @@ int otkl_main(aClient *cptr, aClient *sptr, int parc, char *parv[], char flag) {
 					strlcat(rbuf, parv[i], sizeof(rbuf));
 				}
 			}
-			raisin = (char *)StripControlCodes(StripColors(rbuf)); // No markup pls
+			raisin = (char *)StripControlCodes(rbuf); // No markup pls
 		}
 	}
 

+ 2 - 2
u4/m_anti_amsg.c

@@ -33,7 +33,7 @@ ModDataInfo *amsgMDI; // To store every user's last message with their client po
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_anti_amsg) = {
 	"m_anti_amsg", // Module name
-	"$Id: v1.01 2017/09/13 Gottem$", // Version
+	"$Id: v1.02 2018/04/16 Gottem$", // Version
 	"Drop messages originating from /amsg", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -119,7 +119,7 @@ static int anti_amsg_override(Cmdoverride *ovr, aClient *cptr, aClient *sptr, in
 	// Also duplicate messages at the exact same time
 	else if(!BadPtr(parv[2])) {
 		// Some shitty ass scripts may use different colours/markup across chans, so fuck that
-		if(!(body = (char *)StripColors(parv[2])) || !(body = (char *)StripControlCodes(body)))
+		if(!(body = (char *)StripControlCodes(parv[2])))
 			return CallCmdoverride(ovr, cptr, sptr, parc, parv);
 
 		amsg = moddata_client(sptr, amsgMDI).ptr; // Get client data

+ 2 - 2
u4/m_anticaps.c

@@ -24,7 +24,7 @@ int lcIt = 0; // Lowercase 'em instead
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_anticaps) = {
 	"m_anticaps", // Module name
-	"$Id: v1.05 2017/11/26 Gottem$", // Version
+	"$Id: v1.06 2018/04/16 Gottem$", // Version
 	"Block/lowercase messages that contain a configurable amount of capital letters", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -198,7 +198,7 @@ static int anticaps_override(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int
 	snprintf(p, sizeof(p), "%s", parv[2]); // Copy that shit fam
 
 	// Some shitty ass scripts may use different colours/markup across chans, so fuck that
-	if(!(plaintext = (char *)StripColors(p)) || !(plaintext = (char *)StripControlCodes(plaintext)))
+	if(!(plaintext = (char *)StripControlCodes(p)))
 		return CallCmdoverride(ovr, cptr, sptr, parc, parv);
 
 	perc = len = caps = 0;

+ 3 - 3
u4/m_block_masshighlight.c

@@ -65,7 +65,7 @@ struct {
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_block_masshighlight) = {
 	"m_block_masshighlight", // Module name
-	"$Id: v1.06 2017/12/28 Gottem/k4be$", // Version
+	"$Id: v1.07 2018/04/16 Gottem/k4be$", // Version
 	"Prevent mass highlights network-wide", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -600,7 +600,7 @@ char *masshighlight_hook_prechanmsg(aClient *sptr, aChannel *chptr, char *text,
 		hl_cur = moddata_membership(lp2, massHLMDI).i; // Get current count
 
 		// In case someone tries some funny business =]
-		if(!(cleantext = (char *)StripColors(text)) || !(cleantext = (char *)StripControlCodes(cleantext)))
+		if(!(cleantext = (char *)StripControlCodes(text)))
 			return text;
 
 		for(werd = strtoken(&p, cleantext, muhcfg.delimiters); werd; werd = strtoken(&p, NULL, muhcfg.delimiters)) { // Split that shit
@@ -698,4 +698,4 @@ char *masshighlight_hook_prechanmsg(aClient *sptr, aChannel *chptr, char *text,
 	}
 
 	return text;
-}
+}

+ 8 - 5
u4/m_uniquemsg.c

@@ -28,7 +28,7 @@ ModDataInfo *umsgMDI; // To store some shit with the channel ;]
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_uniquemsg) = {
 	"m_uniquemsg", // Module name
-	"$Id: v1.01 2017/07/30 Gottem$", // Version
+	"$Id: v1.02 2018/04/16 Gottem$", // Version
 	"Implements chmode +U to prevent people from repeating messages", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -102,8 +102,8 @@ int wasRepeat(aChannel *chptr, char *text) {
 	char *last, *clean;
 	int repeat = 0;
 	if((last = moddata_channel(chptr, umsgMDI).str)) {
-		clean = (char *)StripControlCodes(StripColors(text)); // Strip all markup shit (bold, italikk etc) and colours
-		if(!stricmp(last, clean)) // Case-insensitive pls
+		clean = (char *)StripControlCodes(text); // Strip all markup shit (bold, italikk etc) and colours
+		if(clean && !stricmp(last, clean)) // Case-insensitive pls
 			repeat = 1;
 	}
 	return repeat;
@@ -148,6 +148,7 @@ int uniquemsg_chmode_isok(aClient *sptr, aChannel *chptr, char mode, char *para,
 }
 
 char *uniquemsg_hook_prechanmsg(aClient *sptr, aChannel *chptr, char *text, int notice) {
+	char *clean;
 	if(IsUMsg(chptr)) { // Only do shit when the chmode is set =]
 		if(!is_chanownprotop(sptr, chptr) && wasRepeat(chptr, text)) { // People with +o and higher are exempt from the limitation
 			sendto_one(sptr, ":%s NOTICE %s :This channel doesn't allow repeated messages", me.name, chptr->chname);
@@ -155,7 +156,9 @@ char *uniquemsg_hook_prechanmsg(aClient *sptr, aChannel *chptr, char *text, int
 		}
 		if(moddata_channel(chptr, umsgMDI).str) // Already got a string
 			free(moddata_channel(chptr, umsgMDI).str); // Free it first
-		moddata_channel(chptr, umsgMDI).str = strdup((char *)StripControlCodes(StripColors(text))); // Then dup 'em
+		clean = (char *)StripControlCodes(text);
+		moddata_channel(chptr, umsgMDI).str = (clean ? strdup(clean) : NULL); // Then dup 'em
 	}
 	return text;
-}
+}
+

+ 2 - 2
uncommon/m_repeatprot.c

@@ -63,7 +63,7 @@ time_t trigTimespan = 0;
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_repeatprot) = {
 	"m_repeatprot", // Module name
-	"$Id: v1.25 2017/11/21 Gottem$", // Version
+	"$Id: v1.26 2018/04/16 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
@@ -582,7 +582,7 @@ static int repeatprot_override(Cmdoverride *ovr, aClient *cptr, aClient *sptr, i
 	for(i = 0; msg[i]; i++)
 		msg[i] = tolower(msg[i]);
 
-	plaintext = StripColors(msg);
+	plaintext = (char *)StripControlCodes(msg);
 	pr = plaintext;
 	pw = plaintext;
 	while(*pr) {

+ 2 - 2
uncommon/m_textshun.c

@@ -91,7 +91,7 @@ static char *muhhalp[] = {
 // Dat dere module header
 ModuleHeader MOD_HEADER(m_textshun) = {
 	"m_textshun", // Module name
-	"$Id: v1.04 2017/10/21 Gottem$", // Version
+	"$Id: v1.05 2018/04/16 Gottem$", // Version
 	"Drop messages based on nick and body", // Description
 	"3.2-b8-1", // Modversion, not sure wat do
 	NULL
@@ -359,7 +359,7 @@ char *_check_premsg(aClient *sptr, char *text) {
 	char *body;
 
 	// Strip all markup shit (bold, italikk etc) and colours
-	if(!(body = (char *)StripColors(text)) || !(body = (char *)StripControlCodes(body)))
+	if(!(body = (char *)StripControlCodes(text)))
 		return text;
 
 	if(!IsServer(sptr) && !IsMe(sptr) && !IsULine(sptr) && !IsOper(sptr) && (tEntry = match_tline(sptr, body))) { // Servers, U:Lines and opers are exempt for obv raisins