added filter code
[spider.git] / perl / DXCommandmode.pm
index de59160663c080356a11a354c5a52b098f0f3ea1..bce0255fd4750002963821575ccd462f5173ddda 100644 (file)
@@ -22,6 +22,7 @@ use DXLogPrint;
 use DXBearing;
 use CmdAlias;
 use FileHandle;
+use Filter;
 use Carp;
 
 use strict;
@@ -65,7 +66,7 @@ sub start
        $self->{consort} = $line;       # save the connection type
        
        # set some necessary flags on the user if they are connecting
-       $self->{beep} = $self->{wwv} = $self->{talk} = $self->{ann} = $self->{here} = $self->{dx} = 1;
+       $self->{beep} = $self->{wwv} = $self->{wx} = $self->{talk} = $self->{ann} = $self->{here} = $self->{dx} = 1;
        #  $self->prompt() if $self->{state} =~ /^prompt/o;
        
        # add yourself to the database
@@ -86,7 +87,10 @@ sub start
        $self->send($self->msg('qthe1')) if !$user->qth;
        $self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
        $self->send($self->msg('hnodee1')) if !$user->qth;
+       $self->send($self->msg('msgnew')) if DXMsg::for_me($call);
 
+       # get the filters
+       $self->{spotfilter} = Filter::read_in('spots', $call);
        
        $self->send($self->msg('pr', $call));
 }
@@ -130,7 +134,7 @@ sub normal
                        $self->state('prompt');
                }
        } else {
-               @ans = run_cmd($self, $cmdline) if length $cmdline;
+               @ans = run_cmd($self, $cmdline);           # if length $cmdline;
                
                if ($self->{pagelth} && @ans > $self->{pagelth}) {
                        my $i;
@@ -175,6 +179,8 @@ sub run_cmd
                        return (1, "Syserr: Eval err $errstr on stored func $self->{func}");
                }
        } else {
+
+               return () if length $cmdline == 0;
                
                # strip out //
                $cmdline =~ s|//|/|og;