X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fread.pl;h=076e8dde7dd2ce277ff890d298f5e54b88d1c755;hb=eac4538f1f78b3d014539dc548fc6322e8337429;hp=0056530a26e40a99b7d1872f992f6907f26974c8;hpb=ba0bc47c95759a369af81fb19556c48261530a79;p=spider.git diff --git a/cmd/read.pl b/cmd/read.pl index 0056530a..076e8dde 100644 --- a/cmd/read.pl +++ b/cmd/read.pl @@ -3,7 +3,7 @@ # # Copyright (c) Dirk Koopman G1TLH # -# $Id$ +# # my ($self, $line) = @_; @@ -42,28 +42,30 @@ for $msgno (@f) { push @out, @body; # mark it as read - $ref->read($ref->read() + 1); - $ref->store(\@body); # note call by reference! + unless ($ref->private && $ref->to ne $self->call) { + $ref->read($ref->read() + 1); + $ref->store(\@body); # note call by reference! - # if it had a read receipt on it generate a new message to send back to - # the sender. - if ($ref->rrreq) { - my $sub = $ref->subject; - $sub = "Re: $sub" unless $sub =~ /^\s*re:/i; - my $to = $ref->to; - my $from = $ref->from; - my $rref = DXMsg->alloc(1, $from, $main::mycall, time, - 1, $sub, $main::mycall, 0, 0 ); - my $msgno = DXMsg::next_transno("Msgno"); - $rref->msgno($msgno); - $rref->gotit( [ "$main::mycall" ] ); - $rref->store( [ "Return receipt from delivering node. Message read by $to." ] ); - DXMsg::add_dir($rref); - DXMsg::queue_msg(0); - } + # if it had a read receipt on it generate a new message to send back to + # the sender. + if ($ref->rrreq) { + my $sub = $ref->subject; + $sub = "Re: $sub" unless $sub =~ /^\s*re:/i; + my $to = $ref->to; + my $from = $ref->from; + my $rref = DXMsg->alloc(1, $from, $main::mycall, time, + 1, $sub, $main::mycall, 0, 0 ); + my $msgno = DXMsg::next_transno("Msgno"); + $rref->msgno($msgno); + $rref->gotit( [ "$main::mycall" ] ); + $rref->store( [ "Return receipt from delivering node. Message read by $to." ] ); + DXMsg::add_dir($rref); + DXMsg::queue_msg(0); + } - # remember this one as the last one read - $self->lastread($msgno); + # remember this one as the last one read + $self->lastread($msgno); + } } return (1, @out);