X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXMsg.pm;h=17e961769eb9e6bce882e79c01f8caffc9e0db78;hb=5564fb00052dcfaf183fe6b4c0c55ad674f6c467;hp=d5a168e7ced7e20120d5e44af2493fdfcf07b1ce;hpb=4c89d8b54e6b38a0dfd1eb2674d2a3327919883b;p=spider.git diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index d5a168e7..17e96176 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\x80-\x9f]/./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) { @@ -723,7 +724,7 @@ sub queue_msg $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; } @@ -1085,6 +1086,24 @@ sub do_send_stuff delete $self->{loc}; $self->func(undef); $self->state('prompt'); + } elsif ($line =~ m|^/+\w+|) { + # this is a command that you want display for your own reference + # or if it has TWO slashes is a command + $line =~ s|^/||; + my $store = $line =~ s|^/+||; + my @in = $self->run_cmd($line); + push @out, @in; + if ($store) { + foreach my $l (@in) { + if (my @ans = BadWords::check($l)) { + $self->{badcount} += @ans; + Log('msg', $self->call . " used badwords: @ans to @{$loc->{to}} subject: '$loc->{subject}' in msg") unless $loc->{reject}; + Log('msg', "line: $l"); + $loc->{reject}++; + } + push @{$loc->{lines}}, length($l) > 0 ? $l : " "; + } + } } else { if (my @ans = BadWords::check($line)) { $self->{badcount} += @ans;