+01Nov00=======================================================================
+1. put PC11 field 2 check back to m for pc text.
31Oct00=======================================================================
1. add 0x8e to the list of characters we clobber (make xterm go into graphics
mode).
@checklist =
(
[ qw(c c m bp bc c) ], # pc10
- [ qw(f c d t m c c h) ], # pc11
+ [ qw(f m d t m c c h) ], # pc11
[ qw(c bc m bp bm p h) ], # pc12
[ qw(c h) ], #
[ qw(c h) ], #
return $self->{name};
}
+package Filter::Cmd;
+
+use strict;
+use vars qw(@ISA);
+@ISA = qw(Filter);
+
+# the general purpose command processor
+# this is called as a subroutine not as a method
+sub process_cmd
+{
+ my ($self, $dxchan, $line) = @_;
+ my $ntoken = 0;
+ my $fno = 1;
+ my $filter;
+ my ($flag, $call);
+
+ # check the line for non legal characters
+ return ('ill', $dxchan->msg('e19')) if $line =~ /[^\s\w,_\/]/;
+
+ while (my @f = split /\s+/, $line) {
+ if ($ntoken == 0) {
+
+ if (@f && $dxchan->priv >= 9 && DXUser->get($f[0])) {
+ $call = shift @f;
+ if ($f[0] eq 'input') {
+ shift @f;
+ $flag++;
+ }
+ } else {
+ $call = $dxchan->call;
+ }
+
+ if (@f && $f[0] =~ /^\d+$/) {
+ $fno = shift @f;
+ }
+
+ $filter = Filter::read_in('spots', $call, $flag) or new Filter ('spots', $call, $flag);
+
+ $ntoken++;
+ next;
+ }
+
+ # do the rest of the filter tokens
+ if (@f) {
+ my $tok = shift @f;
+ if (@f) {
+ my $val = shift @f;
+
+ my $fref;
+ foreach $fref (@$self) {
+ if ($fref->[0] eq $tok) {
+
+ }
+ }
+ } else {
+ return ('no', $dxchan->msg('filter2', $tok));
+ }
+ }
+
+ }
+ $flag = $flag ? "in_" : "";
+ return (0, $dxchan->msg('filter1', $fno, "$flag$call"));
+}
+
package Filter::Old;
use strict;
db9 => 'Database $_[0] removed',
db10 => '$_[0] records imported into $_[1]',
db11 => 'Sending your request(s) to $_[0], please stand by...',
+ dfreq1 => 'Invalid freq $_[0] need: eg 0/30000 or hf or hf/cw',
dup => 'Sorry, this is a duplicate',
dx1 => 'Frequency $_[0] not in band (see show/band); usage: DX [BY call] freq call comments',
dx2 => 'Need a callsign; usage: DX [BY call] freq call comments',
e16 => 'File \"$_[0]\" exists',
e17 => 'Please don\'t use the words: @_ on here',
e18 => 'Cannot connect to $_[0] ($!)',
+ e19 => 'Invalid character in line',
+ e20 => 'token $_[0] not recognised',
echoon => 'Echoing enabled',
echooff => 'Echoing disabled',
export1 => 'usage: export <msgno> <filename>',
export2 => '$_[3] has error exporting msg $_[0] to $_[1] ($_[2])',
export3 => '$_[2 ] exported msg $_[0] to $_[1]',
+ filter1 => 'Filter $_[0] updated $_[1]',
+ filter2 => 'Need a value for $_[0]',
grids => 'DX Grid flag set on $_[0]',
gridu => 'DX Grid flag unset on $_[0]',
helpe1 => 'Help system unavailable, tell sysop',
use DXDupe;
use strict;
-use vars qw($fp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage);
+use vars qw($fp $maxspots $defaultspots $maxdays $dirprefix $duplth $dupage $filterdef);
$fp = undef;
$maxspots = 50; # maximum spots to return
$dirprefix = "spots";
$duplth = 20; # the length of text to use in the deduping
$dupage = 3*3600; # the length of time to hold spot dups
+$filterdef = bless ([
+ # tag, sort, field, priv, special parser
+ ['freq', 'r', 0, 0, \&decodefreq],
+ ['call', 'c', 1],
+ ['info', 't', 3],
+ ['by', 'c', 4],
+ ['call_dxcc', 'n', 5],
+ ['by_dxcc', 'n', 6],
+ ['origin', 'c', 7, 9],
+ ['call_itu', 'n', 8],
+ ['call_zone', 'n', 9],
+ ['by_itu', 'n', 10],
+ ['by_zone', 'n', 11],
+ ['channel', 'n', 12, 9],
+ ], 'Filter::Cmd');
+
+
+sub decodefreq
+{
+ my $dxchan = shift;
+ my $l = shift;
+ my @f = split /,/, $l;
+ my @out;
+ my $f;
+
+ foreach $f (@f) {
+ my ($a, $b) = $f =~ m{^(\d+)/(\d+)$};
+ if ($a && $b) {
+ push @out, $a, $b;
+ } elsif (($a, $b) = $f =~ m{^(\w+)(?:/(\w+))?$}) {
+ $b = lc $b if $b;
+ my @fr = Bands::get_freq(lc $a, $b);
+ if (@fr) {
+ push @out, @fr; # add these to the list
+ } else {
+ return ('dfreq', $dxchan->msg('dfreq1', $f));
+ }
+ } else {
+ return ('dfreq', $dxchan->msg('e20', $f));
+ }
+ }
+ return (0, join(',', @out));
+}
sub init
{