2. reduce the number R: lines on a bull from a bbs to 2 (the origin and the
last port of call).
3. ignore deleted messages for queuing purposes
+4. store deleted status across restarts!
03Oct01=======================================================================
1. don't allow @WWW to become a 'TO' field...
2. handle @gb7tlh.#35.eu type addresses as well
$self->{origin} = shift;
$self->{'read'} = shift;
$self->{rrreq} = shift;
+ $self->{delete} = shift;
+ $self->{deletetime} = shift;
$self->{gotit} = [];
# $self->{lastt} = $main::systime;
$self->{lines} = [];
if ($ref) {
if ($ref->{private}) { # remove it if it private and gone off site#
Log('msg', "Message $ref->{msgno} from $ref->{from} sent to $fromnode and deleted");
- $ref->{delete}++;
- $ref->{deletetime} = $main::systime + $residencetime;
+ $ref->mark_delete;
} else {
Log('msg', "Message $ref->{msgno} from $ref->{from} sent to $fromnode");
push @{$ref->{gotit}}, $fromnode; # mark this up as being received
if ($pcno == 49) { # global delete on subject
for (@msg) {
if ($_->{from} eq $f[1] && $_->{subject} eq $f[2]) {
- $_->{delete}++;
- $_->{deletetime} = $main::systime + $residencetime;
+ $_->mark_delete;
Log('msg', "Message $_->{msgno} from $_->{from} ($_->{subject}) fully deleted");
DXChannel::broadcast_nodes($line, $self);
}
if (defined $fh) {
my $rr = $ref->{rrreq} ? '1' : '0';
my $priv = $ref->{private} ? '1': '0';
- print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr\n";
+ my $del = $ref->{delete} ? '1' : '0';
+ my $delt = $ref->{deletetime} || '0';
+ print $fh "=== $ref->{msgno}^$ref->{to}^$ref->{from}^$ref->{t}^$priv^$ref->{subject}^$ref->{origin}^$ref->{'read'}^$rr^$del^$delt\n";
print $fh "=== ", join('^', @{$ref->{gotit}}), "\n";
my $line;
$ref->{size} = 0;
}
}
+sub mark_delete
+{
+ my $ref = shift;
+ my $t = shift;
+ $t = $main::systime + $residencetime unless defined $t;
+
+ $ref->{delete}++;
+ $ref->{deletetime} = $t;
+ $ref->store( [$ref->read_msg_body] );
+}
+
# clean out old messages from the message queue
sub clean_old
{
# mark old messages for deletion
foreach $ref (@msg) {
if (ref($ref) && !$ref->{keep} && $ref->{t} < $main::systime - $maxage) {
- $ref->{delete} = 1;
+
+ # this is for IMMEDIATE destruction
+ $ref->{delete}++;
$ref->{deletetime} = 0;
}
}