From: djk Date: Mon, 8 Feb 1999 21:42:21 +0000 (+0000) Subject: added RR handling X-Git-Tag: R_1_24~17 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=57dbfe8cfdaacb84832c1a485b737b6c670b6ac4;p=spider.git added RR handling --- diff --git a/Changes b/Changes index 64e40c93..9a06a748 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ 08Feb99======================================================================== 1. added a $SIG{ALRM} in the client to actually catch the alarm when it goes -off which means that the netrom/ax25 call programs terminate properly! +off which means that the netrom/ax25 call programs terminate properly (and not +loop as fast as their little legs can paddle, soaking up CPU time). +2. Implemented read receipts as an especial request from G4PDQ. +3. Fiddled with DXUser a bit to see whether I can stop it core dumping on new +users in PC16s on his machine. 30Jan99======================================================================== 1. Some of the dates we get can cause crashes, tried to make it more robust (oh and Y2K compliant) diff --git a/cmd/read.pl b/cmd/read.pl index e21a77e6..fbd243cf 100644 --- a/cmd/read.pl +++ b/cmd/read.pl @@ -16,39 +16,58 @@ my $ref; # if there are no specified message numbers, try and find a private one # that I haven't read yet if (@f == 0) { - foreach $ref (DXMsg::get_all()) { - if ($ref->to eq $self->call && $ref->private && !$ref->read) { - push @f, $ref->msgno; - last; + foreach $ref (DXMsg::get_all()) { + if ($ref->to eq $self->call && $ref->private && !$ref->read) { + push @f, $ref->msgno; + last; + } } - } } return (1, $self->msg('read1')) if @f == 0; for $msgno (@f) { - $ref = DXMsg::get($msgno); - if (!$ref) { - push @out, $self->msg('read2', $msgno); - next; - } - if ($self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call ) { - push @out, $self->msg('read3', $msgno); - next; - } - push @out, sprintf "Msg: %d From: %s Date: %6.6s %5.5s Subj: %-30.30s", $msgno, - $ref->from, cldate($ref->t), ztime($ref->t), $ref->subject; - @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); - $ref->store(\@body); # note call by reference! - } - - # remember this one as the last one read - $self->lastread($msgno); + $ref = DXMsg::get($msgno); + if (!$ref) { + push @out, $self->msg('read2', $msgno); + next; + } + if ($self->priv < 5 && $ref->private && $ref->to ne $self->call && $ref->from ne $self->call ) { + push @out, $self->msg('read3', $msgno); + next; + } + push @out, sprintf "Msg: %d From: %s Date: %6.6s %5.5s Subj: %-30.30s", $msgno, + $ref->from, cldate($ref->t), ztime($ref->t), $ref->subject; + @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); + $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); + } + } + + # remember this one as the last one read + $self->lastread($msgno); + + } return (1, @out);