4
0
Torbjorn Svensson 19 жил өмнө
parent
commit
dc6efaf69b

+ 2 - 0
docs/Changelog

@@ -6,6 +6,8 @@ pisg (0.71) - ??
     Torbjörn:
     * Parsers:
       + Update for miau.pm for miau 0.6.x (mnh, jha)
+      + Fix ShowOnlyTop to use only ActiveNicks (SF #1604942).
+      + Add links in documentation on ShowOnlyTop.
 
 pisg (0.70) - Thu Sep, 14th 2006
    Torbjörn:

+ 2 - 1
docs/pisg-doc.xml

@@ -2308,7 +2308,8 @@
     By enabling this option, stats in the "Big Numbers" and "Interesting
     Numbers" section will only be counted for users who were the most
     active. E.g. users who appear in the "Most Active Nicks" section, as
-    respected by the ActiveNicks and ActiveNicks2 options. See also
+    respected by the <xref linkend="ActiveNicks" /> and 
+    <xref linkend="ActiveNicks2" /> options. See also
     <xref linkend="BigNumbersThreshold" />.
     </para>
     </refsect1>

+ 11 - 1
modules/Pisg/Common.pm

@@ -103,7 +103,7 @@ sub add_url_ignore
 # This will only match if it has seen it used as a nick
 sub is_nick
 {
-    my ($nick) = @_;
+    my ($nick, $wilds) = @_;
     my $lcnick = lc($nick);
 
     if ($aliases{$lcnick}) {
@@ -111,6 +111,16 @@ sub is_nick
     } elsif ($aliasseen{$lcnick}) {
         return $aliasseen{$lcnick}
     }
+
+    # check aliaswilds if were are in _mostusedword()
+    if (defined $wilds) {
+        foreach (keys %aliaswilds) {
+            if ($lcnick =~ /^$_$/i) {
+                add_alias($aliaswilds{$_}, $lcnick);
+                return $aliaswilds{$_};
+            }
+        }
+    }
     return 0;
 }
 

+ 2 - 2
modules/Pisg/HTMLGenerator.pm

@@ -1769,7 +1769,7 @@ sub _mostusedword
 
     foreach my $word (keys %{ $self->{stats}->{wordcounts} }) {
         # Skip people's nicks.
-        next if is_nick($word);
+        next if is_nick($word, $self->{cfg}->{cachedir});
         next if (length($word) < $self->{cfg}->{wordlength});
         $usages{$word} = $self->{stats}->{wordcounts}{$word};
     }
@@ -2413,7 +2413,7 @@ sub _topactive {
         $self->{cfg}->{activenicks2} = $top_nicks-$self->{cfg}->{activenicks};
     }
             
-    (@top_active) = @top_active[0..($self->{cfg}->{activenicks}+$self->{cfg}->{activenicks2}-1)];
+    (@top_active) = @top_active[0..($self->{cfg}->{activenicks}-1)];
     $self->{stats}->{topactive_lines} = @top_active ? $self->{stats}->{lines}{$top_active[0]} : 1;
             
     foreach (@top_active) {

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

@@ -145,7 +145,12 @@ sub analyze
         };
         my $l = {};
 
-        unless ($self->{cfg}->{cachedir} and $self->_read_cache(\$s, \$l, $logfile)) {
+        if ($self->{cfg}->{cachedir} and $self->_read_cache(\$s, \$l, $logfile)) {
+            # take care of false nicks/words, this only happens with cache
+            foreach (keys %{$s->{lastvisited}}) {
+                find_alias($_);
+            }
+        } else {
             $self->_parse_file($s, $l, $logfile);
             if ($self->{cfg}->{cachedir}) {
                 $self->_update_cache($s, $l, $logfile);