Просмотр исходного кода

Fix voice/devoice detection with xchat format

Morten Brix Pedersen 24 лет назад
Родитель
Сommit
1754d2a763
2 измененных файлов с 8 добавлено и 1 удалено
  1. 1 0
      docs/Changelog
  2. 7 1
      modules/Pisg/Parser/Format/xchat.pm

+ 1 - 0
docs/Changelog

@@ -2,6 +2,7 @@ pisg (x.xx)
    * Add "ShowOnlyTop" option which can be used if you only want to have stats
      for the users which appeared in the "Most Active Nicks" (top talkers)
      section. (thanks, mincus)
+   * Fix voice/devoice detection with xchat format.
 
 pisg (0.42) - Fri Nov, 1st 2002
    * ircII logfile support added (thanks, James Andrewartha)

+ 7 - 1
modules/Pisg/Parser/Format/xchat.pm

@@ -14,7 +14,7 @@ sub new
         cfg => $args{cfg},
         normalline => '(\d+):\d+:\d+ <([^>\s]+)>\s+(.*)',
         actionline => '(\d+):\d+:\d+ (\*){1,}\s+(\S+) (.*)',
-        thirdline  => '(\d+):(\d+):\d+ .{1,}--\s+(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)',
+        thirdline  => '(\d+):(\d+):\d+ .{1,}--\s+(\S+) (\S+) (\S+) (\S+) (\S+) ?(\S+)? ?(.*)?',
     };
 
     bless($self, $type);
@@ -79,6 +79,12 @@ sub thirdline
         } elsif (($4.$5) eq 'removeschannel') {
             $hash{newmode} = '-o';
 
+        } elsif (($4.$5) eq 'givesvoice') {
+            $hash{newmode} = '+v';
+
+        } elsif (($4.$5) eq 'removesvoice') {
+            $hash{newmode} = '-v';
+
         } elsif (($5.$6) eq 'hasjoined') {
             $hash{newjoin} = $1;