Explorar el Código

Ignore smileys getting counted as uppercase

Morten Brix Pedersen hace 24 años
padre
commit
f481d4cb45
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  1. 6 3
      modules/Pisg/Parser/Logfile.pm

+ 6 - 3
modules/Pisg/Parser/Logfile.pm

@@ -266,12 +266,15 @@ sub _parse_file
                         if ($saying =~ /!/);
 
                     if ($saying !~ /[a-z]/ && $saying =~ /[A-Z]/) {
-                        $stats->{allcaps}{$nick}++;
-                        push @{ $lines->{allcaplines}{$nick} }, $line;
+                        # Ignore single smileys on a line. eg. '<user> :P'
+                        if ($saying !~ /^[8;:=][ ^-o]?[)pPD}\]>]$/) {
+                            $stats->{allcaps}{$nick}++;
+                            push @{ $lines->{allcaplines}{$nick} }, $line;
+                        }
                     }
 
                     $stats->{foul}{$nick}++
-                    if ($saying =~ /$self->{cfg}->{foul}/i);
+                        if ($saying =~ /$self->{cfg}->{foul}/i);
 
                     # Who smiles the most?
                     # A regex matching al lot of smilies