X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=bb80e6c1908183ffbb16bf027a34e76c30478243;hb=f0323dc530e2aa3fe5b8cd50b1c8c35aac67c52e;hp=dbcd8097bafce544231a37f7e58565f55999e3c3;hpb=42846321acd959aa93c2c2afd2b1f0a67f8accaf;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index dbcd8097..bb80e6c1 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -518,6 +518,7 @@ sub store 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"; } @@ -530,7 +531,7 @@ sub store } # 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) { @@ -788,14 +789,15 @@ sub for_me { 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 @@ -1091,9 +1093,25 @@ sub do_send_stuff Log('msg', "line: $line"); $loc->{reject}++; } + + if ($loc->{lines} && @{$loc->{lines}}) { + push @{$loc->{lines}}, length($line) > 0 ? $line : " "; + } else { + # temporarily store any R: lines so that we end up with + # only the first and last ones stored. + if ($line =~ m|^R:\d{6}/\d{4}|) { + push @{$loc->{tempr}}, $line; + } else { + if (exists $loc->{tempr}) { + push @{$loc->{lines}}, shift @{$loc->{tempr}}; + push @{$loc->{lines}}, pop @{$loc->{tempr}} if @{$loc->{tempr}}; + delete $loc->{tempr}; + } + push @{$loc->{lines}}, length($line) > 0 ? $line : " "; + } + } # i.e. it ain't and end or abort, therefore store the line - push @{$loc->{lines}}, length($line) > 0 ? $line : " "; } } return @out;