1. Fixed problems with sh/rcmd (talk/ann/log) with a callsign as argument and
[spider.git] / perl / DXLogPrint.pm
index fff39d1256894e6a1765249f0ac157d85fa65b0a..8a12b05c2791aa3f137fc13ce4f821f1dde5e528 100644 (file)
@@ -30,13 +30,17 @@ sub print
        my $to = shift;
        my @date = $self->unixtoj(shift);
        my $pattern = shift;
+       my $who = uc shift;
        my $search;
        my @in;
        my @out;
        my $eval;
        my $count;
            
-       $search = $pattern ? "\$ref->[1] =~ /$pattern/" : '1' ;
+       $search = '1' unless $pattern || $who;
+       $search = "\$ref->[1] =~ /$pattern/" if $pattern;
+       $search .= ' && ' if $pattern && $who;
+       $search .= "(\$ref->[2] =~ /$who/ || \$ref->[3] =~ /$who/)" if $who;
        $eval = qq(
                           my \$c;
                           my \$ref;
@@ -98,7 +102,7 @@ sub print_item
        } elsif ($ref[1] eq 'talk') {
                $s = "$ref[3] -> $ref[2] ($ref[4]) $ref[5]";
        } elsif ($ref[1] eq 'ann') {
-               $s = "$ref[2] -> $ref[3] $ref[4]";
+               $s = "$ref[3] -> $ref[2] $ref[4]";
        } else {
                $s = "$ref[2]";
        }