4 # Copyright (c) Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @f = split /\s+/, $line;
16 # if there are no specified message numbers, try and find a private one
17 # that I haven't read yet
19 foreach $ref (DXMsg::get_all()) {
20 if ($ref->to eq $self->call && $ref->private && !$ref->read && !$ref->delete) {
27 return (1, $self->msg('read1')) if @f == 0;
30 $ref = DXMsg::get($msgno);
32 push @out, $self->msg('read2', $msgno);
35 if ($self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call ) {
36 push @out, $self->msg('read3', $msgno);
39 push @out, sprintf "Msg: %d From: %s Date: %6.6s %5.5s Subj: %-30.30s", $msgno,
40 $ref->from, cldate($ref->t), ztime($ref->t), $ref->subject;
41 @body = $ref->read_msg_body;
45 unless ($ref->private && $ref->to ne $self->call) {
46 $ref->read($ref->read() + 1);
47 $ref->store(\@body); # note call by reference!
49 # if it had a read receipt on it generate a new message to send back to
52 my $sub = $ref->subject;
53 $sub = "Re: $sub" unless $sub =~ /^\s*re:/i;
55 my $from = $ref->from;
56 my $rref = DXMsg->alloc(1, $from, $main::mycall, time,
57 1, $sub, $main::mycall, 0, 0 );
58 my $msgno = DXMsg::next_transno("Msgno");
60 $rref->gotit( [ "$main::mycall" ] );
61 $rref->store( [ "Return receipt from delivering node. Message read by $to." ] );
62 DXMsg::add_dir($rref);
66 # remember this one as the last one read
67 $self->lastread($msgno);