Преглед изворни кода

Add channel owner (~) and admin (&) chars in various parsers

Christoph Berg пре 21 година
родитељ
комит
b6c485b902

+ 2 - 2
docs/Changelog

@@ -4,8 +4,8 @@ pisg (0.65) - ??
      though (thanks to Nico for the test log).
    * Fixed breakage when multiple LogDirs were given (thanks to Toni Viemerö
      for the report, SF tracker #1155433).
-   * Add channel owner (~) and admin (&) chars in irssi.pm (reported by Scelt
-     in SF tracker #1170470).
+   * Add channel owner (~) and admin (&) chars in various parsers (reported by
+     Scelt in SF tracker #1170470).
    The "Christoph got bored in Ireland" changes:
    * Get channel music charts with ShowCharts and ChartsHistory (suggested by
      Sven in SF tracker #1164596).

+ 2 - 2
modules/Pisg/Parser/Format/IRCAP.pm

@@ -49,7 +49,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -78,7 +78,7 @@ sub thirdline
         $hash{hour} = $1;
         $hash{min}  = $2;
         $hash{saying}  = $3;
-        ($hash{nick}  = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 	if ($#linea >= 2 and $linea[2] eq 'topic:') {
 	#print $linea[2], "\n";
 	}

+ 7 - 7
modules/Pisg/Parser/Format/Trillian.pm

@@ -27,7 +27,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
         $hash{saying} =~ s/\(Link: ((http|https|ftp|telnet|news):\/\/.*?)\)\1/$1/;
 
@@ -45,7 +45,7 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
         $hash{saying} =~ s/\(Link: ((http|https|ftp|telnet|news):\/\/.*?)\)\1/$1/;
 
@@ -64,18 +64,18 @@ sub thirdline
 
         $hash{hour} = $1;
         $hash{min}  = $2;
-        ($hash{nick}  = $3) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $3) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($3 =~ /^(\S+) has been kicked off channel (\S+) by (\S+) .+/) {
-            ($hash{nick}  = $1) =~ s/^[@%\+]//o; # Remove prefix
+            ($hash{nick}  = $1) =~ s/^[@%\+~&]//o; # Remove prefix
             $hash{kicker} = $3;
 
         } elsif ($3 =~ /^(\S+) has changed the topic on channel (\S+) to (.+)/) {
-            ($hash{nick}  = $1) =~ s/^[@%\+]//o; # Remove prefix
+            ($hash{nick}  = $1) =~ s/^[@%\+~&]//o; # Remove prefix
              $hash{newtopic} = $3;
 
         } elsif ($3 =~ /^Mode change \"(\S+)[^\"]+\".+ by (.+)$/) {
-            ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+            ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
              $hash{newmode} = $1;
 
         } elsif ($3 =~ /^(\S+) \S+ has joined channel \S+/) {
@@ -83,7 +83,7 @@ sub thirdline
             $hash{newjoin} = $1;
 
         } elsif ($3 =~ /^(\S+) is now known as (\S+)/) {
-            ($hash{nick}  = $1) =~ s/^[@%\+]//o; # Remove prefix
+            ($hash{nick}  = $1) =~ s/^[@%\+~&]//o; # Remove prefix
             $hash{newnick} = $2;
         }
 

+ 4 - 4
modules/Pisg/Parser/Format/Vision.pm

@@ -27,7 +27,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -44,7 +44,7 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -64,14 +64,14 @@ sub thirdline
 
         $hash{hour} = $1;
         $hash{min}  = $2;
-        ($hash{nick}  = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($#line >= 7 && ($line[1].$line[2].$line[3]) eq 'hasbeenkicked') {
             $hash{kicker} = $line[7];
 
         } elsif ($#line >= 4 && ($line[1].$line[2] eq 'Topicchanged')) {
             $hash{newtopic} = join(' ', @line[5..$#line]);
-            ($hash{nick}  = $line[4]) =~ s/^[@%\+]//o; # Remove prefix
+            ($hash{nick}  = $line[4]) =~ s/^[@%\+~&]//o; # Remove prefix
             $hash{nick} =~ s/:$//;
 
         } elsif ($#line >= 3 && ($line[1].$line[2]) eq 'setmode') {

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

@@ -28,7 +28,7 @@ sub normalline
 
         $hash{hour}   = $1;
         $hash{saying} = $3;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -45,7 +45,7 @@ sub actionline
 
         $hash{hour}   = $1;
         $hash{saying} = $3;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -64,7 +64,7 @@ sub thirdline
 
         $hash{hour}  = $1;
         $hash{min}   = $2;
-        ($hash{nick} = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick} = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($#line >= 4 && ($line[1].$line[2]) eq 'waskicked') {
             $hash{kicker} = $line[4];

+ 2 - 2
modules/Pisg/Parser/Format/mIRC6.pm

@@ -30,7 +30,7 @@ sub normalline
 
         $hash{hour}   = $1;
         $hash{saying} = $3;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -58,7 +58,7 @@ sub thirdline
         $hash{hour} = $1;
         $hash{min}  = $2;
         $hash{saying} = $3;
-        ($hash{nick} = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick} = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($#line >= 4 && ($line[1].$line[2]) eq 'waskicked' && ($line[$#line] =~ /\)$/)) {
                 $hash{kicker} = $line[4];

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

@@ -52,7 +52,7 @@ sub normalline
 
         $hash{hour}   = $1;
         $hash{saying} = $3;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -69,7 +69,7 @@ sub actionline
 
         $hash{hour}   = $1;
         $hash{saying} = $3;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -89,7 +89,7 @@ sub thirdline
         $hash{hour} = $1;
         $hash{min}  = $2;
         $hash{saying} = $3;
-        ($hash{nick} = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick} = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($#line >= 4 && ($line[1].$line[2]) eq 'waskicked' && ($line[$#line] =~ /\)$/)) {
                 $hash{kicker} = $line[4];

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

@@ -34,7 +34,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -51,7 +51,7 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -71,7 +71,7 @@ sub thirdline
 
         $hash{hour} = $1;
         $hash{min}  = $2;
-        ($hash{nick}  = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $line[0]) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if ($#line >= 4 && ($line[1].$line[2]) eq 'waskicked') {
             $hash{kicker} = $line[4];

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

@@ -27,7 +27,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -44,7 +44,7 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -62,7 +62,7 @@ sub thirdline
 
         $hash{hour} = $1;
         $hash{min}  = $2;
-        ($hash{nick}  = $4) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $4) =~ s/^[@%\+~&]//o; # Remove prefix
 
         if (($3) eq '[KICK]') {
             $hash{kicker} = $8;

+ 2 - 2
modules/Pisg/Parser/Format/virc98.pm

@@ -30,7 +30,7 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;
@@ -47,7 +47,7 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        ($hash{nick}  = $2) =~ s/^[@%\+~&]//o; # Remove prefix
         $hash{saying} = $3;
 
         return \%hash;