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

* Fix problem with muh format and action lines (thanks, Kevin Bralten)

Morten Brix Pedersen 23 лет назад
Родитель
Сommit
0ea3681b00
2 измененных файлов с 5 добавлено и 3 удалено
  1. 1 0
      docs/Changelog
  2. 4 3
      modules/Pisg/Parser/Format/muh.pm

+ 1 - 0
docs/Changelog

@@ -7,6 +7,7 @@ pisg (x.xx)
      Likewise with PicWidth.
    * Quote < and > to &lt; and &gt; even in non-default character set
    * Ignore more 'actions' in mIRC6 format that are actually status messages
+   * Fix problem with muh format and action lines (thanks, Kevin Bralten)
 
 pisg (0.47) - Wed Feb, 26th 2003
    * Fix bug where multiple URLs in same line would have save name as first URL

+ 4 - 3
modules/Pisg/Parser/Format/muh.pm

@@ -13,7 +13,7 @@ sub new
     my $self = {
         cfg => $args{cfg},
         normalline => '^\[\w\w\w \d\d \w\w\w (\d+):\d+:\d+\] <([^>\s]+)>\s+(.*)',
-        actionline => '^\[\w\w\w \d\d \w\w\w (\d+):\d+:\d+\] \*\s+(\S+) (.*)',
+        actionline => '^\[\w\w\w \d\d \w\w\w (\d+):\d+:\d+\] <([^>\s]+)>\sACTION\s+(.*)',
         #thirdline  => '^\[\w\w\w \d\d \w\w\w (\d+):(\d+):\d+\] \*\*\*\s+(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (.*)',
         thirdline  => '^\[\w\w\w \d\d \w\w\w (\d+):(\d+):\d+\] \*\*\*\s+(\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S*)(.*)',
     };
@@ -27,7 +27,7 @@ sub normalline
     my ($self, $line, $lines) = @_;
     my %hash;
 
-    if ($line =~ /$self->{normalline}/o) {
+    if ($line =~ /$self->{normalline}/o and !($line =~ /$/)) {
 
         $hash{hour}   = $1;
         $hash{nick}   = $2;
@@ -47,7 +47,8 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        $hash{nick}   = $2;
+        $hash{nick}   = $2;
+
         $hash{saying} = $3;
 
         return \%hash;