X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fread.pl;h=9d57307fa80b2edf78a285ec49275ee168dfd6ae;hb=c71a54705682b0a66d6729af5f043dc2c2df276a;hp=21b20e0699459e407b784a6be8b24e7afafea947;hpb=5ba68ecc9ddb9ccdefe75256f73af2ba92fd221c;p=spider.git diff --git a/cmd/read.pl b/cmd/read.pl index 21b20e06..9d57307f 100644 --- a/cmd/read.pl +++ b/cmd/read.pl @@ -17,7 +17,7 @@ my $ref; # that I haven't read yet if (@f == 0) { foreach $ref (DXMsg::get_all()) { - if ($ref->to eq $self->call && $ref->private && !$ref->read) { + if ($ref->to eq $self->call && $ref->private && !$ref->read && !$ref->delete) { push @f, $ref->msgno; last; } @@ -41,13 +41,13 @@ for $msgno (@f) { @body = $ref->read_msg_body; push @out, @body; - # mark my privates as read - if ($ref->private && $self->call eq $ref->to && $ref->read == 0) { - $ref->read(1); + # mark it as read + 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. + # the sender. if ($ref->rrreq) { my $sub = $ref->subject; $sub = "Re: $sub" unless $sub =~ /^\s*re:/i; @@ -62,12 +62,10 @@ for $msgno (@f) { 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);