try a different strategy
[spider.git] / perl / DXCommandmode.pm
index e7cf7e972c94a4ac5a401366565035c65460629f..47e25c0b80c8fc56e96649934c635442f7a02507 100644 (file)
@@ -29,6 +29,7 @@ use DXDb;
 use AnnTalk;
 use WCY;
 use Sun;
+use Internet;
 
 use strict;
 use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase);
@@ -81,6 +82,12 @@ sub start
        $self->{logininfo} = $user->wantlogininfo;
        $self->{here} = 1;
 
+       # get the filters
+       $self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'user_default', 0);
+       $self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'user_default', 0);
+       $self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'user_default', 0);
+       $self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'user_default', 0) ;
+
        # clean up qra locators
        my $qra = $user->qra;
        $qra = undef if ($qra && !DXBearing::is_qra($qra));
@@ -296,7 +303,7 @@ sub run_cmd
                
                # split the command line up into parts, the first part is the command
                my ($cmd, $args) = split /\s+/, $cmdline, 2;
-               $args = "" unless $args;
+               $args = "" unless defined $args;
                
                if ($cmd) {
                        
@@ -308,7 +315,7 @@ sub run_cmd
                        my $acmd = CmdAlias::get_cmd($cmd);
                        if ($acmd) {
                                ($cmd, $args) = split /\s+/, "$acmd $args", 2;
-                               $args = "" unless $args;
+                               $args = "" unless defined $args;
                                dbg('command', "aliased cmd: $cmd $args");
                        }
                        
@@ -395,10 +402,10 @@ sub finish
                sleep(1);
        }
 
-       if ($call eq $main::myalias) { # unset the channel if it is us really
-               my $node = DXNode->get($main::mycall);
-               $node->{dxchan} = 0;
-       }
+#      if ($call eq $main::myalias) { # unset the channel if it is us really
+#              my $node = DXNode->get($main::mycall);
+#              $node->{dxchan} = 0;
+#      }
        
        # issue a pc17 to everybody interested
        my $nchan = DXChannel->get($main::mycall);