+02Nov00=======================================================================
+1. updated filtering logic. You will need to RECREATE your filters (clear/spot
+all, then start again) for testing.
01Nov00=======================================================================
1. put PC11 field 2 check back to m for pc text.
2. improve 'simple' callsign checking
my $ref = $busy{$_};
if (exists $ref->{lastt} && $main::systime >= $ref->{lastt} + $timeout) {
dbg('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
+ Log('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node");
$ref->stop_msg($node);
# delay any outgoing messages that fail
my $self = shift;
my $hops = undef;
- my $r = 1;
my $filter;
- foreach $filter ($self->getfilters) {
- $r = 0;
+ my @keys = sort $self->getfilkeys;
+ my $key;
+ my $r = @keys > 0 ? 0 : 1;
+ foreach $key (@keys) {
+ $filter = $self->{$key};
if ($filter->{reject} && exists $filter->{reject}->{code}) {
- next if &{$filter->{reject}->{code}}(\@_);
+ if (&{$filter->{reject}->{code}}(\@_)) {
+ $r = 0;
+ last;
+ } else {
+ $r = 1;
+ }
}
if ($filter->{accept} && exists $filter->{accept}->{code}) {
- next unless &{$filter->{accept}->{code}}(\@_);
+ if (&{$filter->{accept}->{code}}(\@_)) {
+ $r = 1;
+ last;
+ } else {
+ $r = 0;
+ }
}
- $r = 1;
- last;
}
# hops are done differently
$s .= $tok;
$user .= $tok;
next;
+ } elsif ($tok eq 'all') {
+ $s .= '1';
+ $user .= $tok;
+ last;
} elsif ($tok eq 'or') {
$conj = ' || ' if $conj ne ' || ';
next;
$user =~ s/\!/ not /g;
$user =~ s/\s+/ /g;
- return (0, $filter, $fno, $user, "sub { my \$r = shift; return $s }");
+ return (0, $filter, $fno, $user, "sub { my \$r = shift; return ($s) ? 1 : 0 }");
}
package Filter::Old;