mirror of
				https://github.com/pragma-/pbot.git
				synced 2025-10-31 14:47:27 +01:00 
			
		
		
		
	AntiNickSpam: Remove severity due to "false-positive" common-word nicks
This commit is contained in:
		
							parent
							
								
									fc5f003465
								
							
						
					
					
						commit
						b4df71cd71
					
				| @ -65,15 +65,11 @@ sub check_flood { | ||||
|   $channel = lc $channel; | ||||
|   my @words = split /\s+/, $msg; | ||||
|   my @nicks; | ||||
|   my $severity = 0; # increasing severity for each additional unique nick in a single message | ||||
| 
 | ||||
|   foreach my $word (@words) { | ||||
|     $word =~ s/[:;\+,\.!?\@\%\$]+$//g; | ||||
|     if ($self->{pbot}->{nicklist}->is_present($channel, $word) and not grep { $_ eq $word } @nicks) { | ||||
|       $severity++; | ||||
|       for (my $i = 0; $i < $severity; $i++) { | ||||
|         push @{$self->{nicks}->{$channel}}, [scalar gettimeofday, $word]; | ||||
|       } | ||||
|       push @{$self->{nicks}->{$channel}}, [scalar gettimeofday, $word]; | ||||
|       push @nicks, $word; | ||||
|     } | ||||
|   } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pragmatic Software
						Pragmatic Software