فهرست منبع

Fix bug where it didn't do case insensitive compare on channel name and channel in logfile

sbingner 23 سال پیش
والد
کامیت
3d14cea3dc
2فایلهای تغییر یافته به همراه8 افزوده شده و 8 حذف شده
  1. 3 3
      modules/Pisg/Parser/Format/moobot.pm
  2. 5 5
      modules/Pisg/Parser/Format/winbot.pm

+ 3 - 3
modules/Pisg/Parser/Format/moobot.pm

@@ -24,7 +24,7 @@ sub normalline
     my %hash;
 
     if ($line =~ /$self->{normalline}/o and
-	$3 eq $self->{cfg}->{channel}) {
+	lc($3) eq lc($self->{cfg}->{channel})) {
 
         $hash{hour}   = $1;
         $hash{nick}   = $2;
@@ -42,7 +42,7 @@ sub actionline
     my %hash;
 
     if ($line =~ /$self->{actionline}/o and
-	$3 eq $self->{cfg}->{channel}) {
+	lc($3) eq lc($self->{cfg}->{channel})) {
 
         $hash{hour}   = $1;
         $hash{nick}   = $2;
@@ -60,7 +60,7 @@ sub thirdline
     my %hash;
 
     if ($line =~ /$self->{thirdline}/o and
-	$5 eq $self->{cfg}->{channel}) {
+	lc($5) eq ($self->{cfg}->{channel})) {
 
 	my $args = $6;
 

+ 5 - 5
modules/Pisg/Parser/Format/winbot.pm

@@ -24,7 +24,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/o && $3 eq $self->{cfg}->{channel}) {
+    if ($line =~ /$self->{normalline}/o && lc($3) eq lc($self->{cfg}->{channel})) {
 
         $hash{hour}   = $1;
         $hash{nick}   = $2;
@@ -40,7 +40,7 @@ sub actionline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{actionline}/o && $3 eq $self->{cfg}->{channel}) {
+    if ($line =~ /$self->{actionline}/o && lc($3) eq lc($self->{cfg}->{channel})) {
 
         $hash{hour}   = $1;
         $hash{nick}   = $2;
@@ -63,19 +63,19 @@ sub thirdline
         $hash{nick} = $3;
 
         if ($3 =~ /^(\S+) was kicked from (\S+) by (\S+) .+/) {
-            if ($2 eq $self->{cfg}->{channel}) {
+            if (lc($2) eq lc($self->{cfg}->{channel})) {
                 $hash{nick} = $1;
                 $hash{kicker} = $3;
             }
 
         } elsif ($3 =~ /^([^\/]+)\/(\S+) changes topic to \"(.+)\"[^\"]*$/) {
-            if ($2 eq $self->{cfg}->{channel}) {
+            if (lc($2) eq lc($self->{cfg}->{channel})) {
                 $hash{nick} = $1;
                 $hash{newtopic} = $3;
             }
 
         } elsif ($3 =~ /^([^\/]+)\/(\S+) sets mode: (\S+) [^\)]+/) {
-            if ($2 eq $self->{cfg}->{channel}) {
+            if (lc($2) eq lc($self->{cfg}->{channel})) {
                 $hash{nick} = $1;
                 $hash{newmode} = $3;
             }