1. Fixed problems with sh/rcmd (talk/ann/log) with a callsign as argument and
[spider.git] / perl / DXLogPrint.pm
index 54cfc516b2173a2ea850ff3b585d4976df25eaaf..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;