2 # show the contents of the message directory
4 # Copyright (c) Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
16 my @all = grep {!($self->priv < 5 && $_->to ne $self->call && $_->from ne $self->call)} (DXMsg::get_all());
19 my $to = $all[@all-1]->msgno;
27 } elsif ($f =~ /^O/o) { # dir/own
28 @ref = grep { $_->to eq $self->call || $_->from eq $self->call } @all;
30 } elsif ($f =~ /^N/o) { # dir/new
31 @ref = grep { $_->t > $self->user->lastin } @all;
33 } elsif ($f =~ /^S/o) { # dir/subject
36 $f =~ s{(.)}{"\Q$1"}ge;
37 @ref = grep { $_->subject =~ m{$f}i } @all;
40 } elsif ($f eq '>' || $f =~ /^T/o){
44 @ref = grep { $_->to =~ m{$f} } @all;
47 } elsif ($f eq '<' || $f =~ /^F/o){
51 @ref = grep { $_->from =~ m{$f} } @all;
54 } elsif ($f =~ /^(\d+)-(\d+)$/) { # a range of items
57 } elsif ($f =~ /^\d+$/ && $f > 0) { # a number of items
63 @ref = @all unless $sel || @ref;
66 if ($from != 0 || $to != $all[@all-1]->msgno) {
67 @ref = grep {$_->msgno >= $from && $_->msgno <= $to} @ref;
75 last if ++$count >= $n;
78 push @out, $self->msg('e3', 'directory', $line);