+06Mar23=======================================================================
+1. Fix filter error reporting, including incrementing concurrent error count
+ if there are actually any detected parse errors.
+2. Fix warnings on difft.
+3. Add the origin of any incoming SP if it is emailed to the recipient.
04Mar23=======================================================================
1. Fixed regression caused by too many command errors in (startup) script
files. This is caused by much stricter checking of commands entered both
my $sort = 'ann';
my ($r, $filter, $fno) = $AnnTalk::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'rbn';
my ($r, $filter, $fno) = $RBN::filterdef->cmd($self, $sort, $type, $line);
-return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'route';
my ($r, $filter, $fno) = $Route::filterdef->cmd($self, $sort, $type, $line);
-return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'spots';
my ($r, $filter, $fno) = $Spot::filterdef->cmd($self, $sort, $type, $line);
-return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'wcy';
my ($r, $filter, $fno) = $WCY::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'wwv';
my ($r, $filter, $fno) = $Geomag::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'ann';
my ($r, $filter, $fno) = $AnnTalk::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'rbn';
my ($r, $filter, $fno) = $RBN::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'route';
my ($r, $filter, $fno) = $Route::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'spots';
my ($r, $filter, $fno) = $Spot::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'wcy';
my ($r, $filter, $fno) = $WCY::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
my $sort = 'wwv';
my ($r, $filter, $fno) = $Geomag::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+my $ok = $r ? 0 : 1;
+return ($ok, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
if ($ok) {
delete $self->{errors};
} else {
- return $self->_error_out('e26');
+ if (++$self->{errors} > $DXChannel::maxerrors) {
+ $self->send($self->msg('e26'));
+ $self->disconnect;
+ return ();
+ }
}
return map {s/([^\s])\s+$/$1/; $_} @ans;
}
my $fromaddr = $email_from || $main::myemail;
my @headers = ("To: $ref->{to}",
"From: $fromaddr",
- "Subject: [DXSpider: $ref->{from}] $ref->{subject}",
+ "Subject: [DXSpider: $ref->{from}\@$ref->{origin}] $ref->{subject}",
"X-DXSpider-To: $ref->{to}",
"X-DXSpider-From: $ref->{from}\@$ref->{origin}",
"X-DXSpider-Gateway: $main::mycall"
$t -= $h * 3600;
$m = int $t / 60;
$out .= sprintf ("%s${m}m", $adds?' ':'') if $m;
- if ($d == 0 && $adds || $adds == 2) {
+ if (($d == 0 && $adds) || (int $adds && $adds == 2)) {
$s = int $t % 60;
$out .= sprintf ("%s${s}s", $adds?' ':'') if $s;
$out ||= sprintf ("%s0s", $adds?' ':'');
}
return (1, $dxchan->msg('e20', $lasttok)) unless $found;
} else {
- my $s = '{' . decode_regex($tok) . '}' if $tok =~ /^{.*}$/;
+ $s = $tok =~ /^{.*}$/ ? '{' . decode_regex($tok) . '}' : $tok;
return (1, $dxchan->msg('filter2', $s));
}
$lasttok = $tok;
$filter->{$fn}->{$type}->{user} = $user;
$filter->{$fn}->{$type}->{asc} = $s;
- $r = $filter->compile($fn, $type);
- return (1,$r) if $r;
+ $r = $filter->compile($fn, $type); # NOTE: returns an ERROR, therefore 0 = success
+ return (0,$r) if $r;
$r = $filter->write;
return (1,$r) if $r;
export2 => q{$_[3] has error exporting msg $_[0] to $_[1] ($_[2])},
export3 => q{$_[2 ] exported msg $_[0] to $_[1]},
filter1 => q{Filter $_[0] updated for $_[1]},
- filter2 => q{Unknown filter keyword $_[0]},
+ filter2 => q{Parse error on '$_[0]'},
filter3 => q{No filters defined for $_[0]},
filter4 => q{$_[0]$_[1] Filter $_[2] deleted for $_[3]},
filter5 => q{need some filter commands...},