my $line;
$ref->{size} = 0;
foreach $line (@{$lines}) {
+ $line =~ s/[\x00-\x08\x0a-\x1f\xf0-\xff]/./g;
$ref->{size} += (length $line) + 1;
print $fh "$line\n";
}
}
# actual remove all the 'deleted' messages in one hit.
- # this has to me delayed until here otherwise it only does one at
+ # 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;
for (@del) {
$ref->stop_msg($node);
# delay any outgoing messages that fail
- $ref->{waitt} = $main::systime + $waittime + rand(120) if $node ne $main::mycall;
+ $ref->{waitt} = $main::systime + $waittime + int rand(120) if $node ne $main::mycall;
delete $ref->{lastt};
next;
}
{
my $call = uc shift;
my $ref;
+ my $count;
foreach $ref (@msg) {
# is it for me, private and unread?
if ($ref->{to} eq $call && $ref->{private}) {
- return 1 if !$ref->{'read'};
+ $count++ unless $ref->{'read'} || $ref->{delete};
}
}
- return 0;
+ return $count;
}
# start the message off on its travels with a PC28
$loc->{reject}++;
}
- if (@{$loc->{lines}}) {
+ if ($loc->{lines} && @{$loc->{lines}}) {
push @{$loc->{lines}}, length($line) > 0 ? $line : " ";
} else {
# temporarily store any R: lines so that we end up with