07Nov02=======================================================================
1. allow three digit longitudes
+2. make a small change to see if messages now stay in place.
+3. make keep actually stick over a reboot and take it fully into account for
+deletions.
+4. try not to delete new messages (even if this is an update that reads 'old'
+messages with missing fields).
29Oct02=======================================================================
1. make sh/log et al a bit more efficient.
2. fix dupe message in dx.
}
foreach $ref ( @refs) {
- Log('msg', "Message $ref->{msgno} from $ref->{from} to $ref->{to} deleted by $call");
- if ($full) {
- DXChannel::broadcast_nodes(DXProt::pc49($ref->{from}, $ref->{subject}), $main::me);
+ if ($ref->keep) {
+ push @out, $self->msg('m18', $ref->msgno);
+ next;
}
my $tonode = $ref->tonode;
$ref->stop_msg($tonode) if $tonode;
$ref->mark_delete($expunge ? 0 : undef);
push @out, $self->msg('m12', $ref->msgno);
+ Log('msg', "Message $ref->{msgno} from $ref->{from} to $ref->{to} deleted by $call");
+ if ($full) {
+ DXChannel::broadcast_nodes(DXProt::pc49($ref->{from}, $ref->{subject}), $main::me);
+ }
}
return (1, @out);
$self->{'read'} = shift;
$self->{rrreq} = shift;
$self->{delete} = shift;
- $self->{deletetime} = shift || $self->{delete} ? 0 : ($self->{t} + $maxage);
+ $self->{deletetime} = shift || ($self->{t} + $maxage);
+ $self->{keep} = shift;
$self->{gotit} = [];
# $self->{lastt} = $main::systime;
$self->{lines} = [];
# actual remove all the 'deleted' messages in one hit.
# this has to be delayed until here otherwise it only does one at
# a time because @msg is rewritten everytime del_msg is called.
- my @del = grep {!$_->{tonode} && $_->{delete} && $_->{deletetime} < $main::systime} @msg;
+ my @del = grep {!$_->{tonode} && $_->{delete} && !$_->{keep} && $_->{deletetime} < $main::systime} @msg;
for (@del) {
$_->del_msg;
}
my $rr = $ref->{rrreq} ? '1' : '0';
my $priv = $ref->{private} ? '1': '0';
my $del = $ref->{delete} ? '1' : '0';
- my $delt = $ref->{deletetime} || $ref->{t} + $maxage;
- print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr^$del^$delt\n";
+ my $delt = $ref->{deletetime} || '0';
+ my $keep = $ref->{keep} || '0';
+ print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr^$del^$delt^$keep\n";
print $fh "=== ", join('^', @{$ref->{gotit}}), "\n";
my $line;
$ref->{size} = 0;
{
my $ref = shift;
my $t = shift;
+
+ return if $ref->{keep};
+
$t = $main::systime + $residencetime unless defined $t;
$ref->{delete}++;
{
my $ref = shift;
my $t = shift;
- delete $ref->{delete};
- delete $ref->{deletetime};
+ $ref->{delete} = 0;
+ $ref->{deletetime} = 0;
}
# clean out old messages from the message queue
{
my $ref = shift;
my $flag = $ref->{private} && $ref->{read} ? '-' : ' ';
- if ($ref->{delete}) {
+ if ($ref->{keep}) {
+ $flag = '!';
+ } elsif ($ref->{delete}) {
$flag = $ref->{deletetime} > $main::systime ? 'D' : 'E';
}
return sprintf("%6d%s%s%5d %8.8s %8.8s %-6.6s %5.5s %-30.30s",
m15 => 'Message no $_[0] unmarked as sent to $_[1]',
m16 => 'Need a Message number',
m17 => 'Sorry, cannot send messages in $_[0] mode',
+ m18 => 'Sorry, message $_[0] is currently set to KEEP',
msg1 => 'Bulletin Messages Queued',
msg2 => 'Private Messages Queued',
msg3 => 'Msg $_[0]: $_[1] changed from $_[2] to $_[3]',