6b3c4ea95a724957a2256a05ed7b70face4d1a27
[spider.git] / cmd / show / talk.pl
1 #
2 # print out the general log file for talks only
3 #
4 # Copyright (c) 1998 - Dirk Koopman G1TLH
5 #
6 #
7 #
8 my $self = shift;
9
10 my $cmdline = shift;
11 my @f = split /\s+/, $cmdline;
12 my $f;
13 my @out;
14 my ($from, $to, $who); 
15
16 $from = 0;
17 while ($f = shift @f) {                 # next field
18         #  print "f: $f list: ", join(',', @list), "\n";
19         if (!$from && !$to) {
20                 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o;         # is it a from -> to count?
21                 next if $from && $to > $from;
22         }
23         if (!$to) {
24                 ($to) = $f =~ /^(\d+)$/o if !$to;              # is it a to count?
25                 next if $to;
26         }
27         next if $who;
28         if ($f !~ /^\d+/) {
29                 ($who) = $f;
30         }
31 #       ($who) = $f =~ /^(\w+)/o;
32 }
33
34 $to = 20 unless $to;
35 $from = 0 unless $from;
36 if ($self->priv < 6) {
37         $who = $self->call unless $who;
38         return (1, $self->msg('e5')) if $who ne $self->call;
39 }
40
41 return (1, DXLog::print($from, $to, $main::systime, 'talk', $who)) if $self->{_nospawn};
42 return (1, $self->spawn_cmd("show/talk $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'talk', $who]));