UPPER CASED all the callsigns on send
authordjk <djk>
Mon, 18 Jan 1999 12:13:37 +0000 (12:13 +0000)
committerdjk <djk>
Mon, 18 Jan 1999 12:13:37 +0000 (12:13 +0000)
added Filter.pm and Database.pm

Changes
cmd/send.pl
perl/Database.pm [new file with mode: 0644]
perl/Filter.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index 864196b1420aefafd91f787bce0252207153021f..cb3bb25462ede54e2d914be41ee122fc7101ad5f 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,11 @@
+17Jan99========================================================================
+1. fixed some permission problems on DXLog.
+2. There is a circumstance in DXMsg which caused the cluster to stop on an 
+null ref pointer which I can't get to the bottom of but have bandaided out 
+for now.
+3. Started filter and Database code.
+4. Upper cased all the TO callsigns for sending to more than one station in
+messages.
 07Jan99========================================================================
 1. Fixed Geomag after emacs reformatted it wrong so sh/wwv works again.
 2. Added more range checking in WWV spots (they really are a heap of ...)
index 959a8101e531b957c9c9f364dd8f2397fcdebcbc..9717c3afa3e4b578cc8bbde8858f17cb28edf812 100644 (file)
@@ -24,93 +24,93 @@ my $loc;
 
 if ($self->state eq "prompt") {
 
-  my @f = split /\s+/, $line;
+       my @f = split /\s+/, $line;
 
-  # any thing after send?
-  return (1, $self->msg('e6')) if !@f;
+       # any thing after send?
+       return (1, $self->msg('e6')) if !@f;
   
-  $f[0] = uc $f[0];
+       $f[0] = uc $f[0];
   
-  # first deal with copies
-  if ($f[0] eq 'C' || $f[0] eq 'CC' || $f[0] eq 'COPY') {
-    my $i = 1;
-       my $rr = '0';
-       if (uc $f[$i] eq 'RR') {
-         $rr = '1';
-         $i++;
-       }
-       my $oref = DXMsg::get($f[$i]);
-    #return (0, $self->msg('esend1', $f[$i])) if !$oref;
-       #return (0, $self->msg('esend2')) if $i+1 >  @f;
-    return (0, "msgno $f[$i] not found") if !$oref;
-       return (0, "need a callsign") if $i+1 >  @f;
+       # first deal with copies
+       if ($f[0] eq 'C' || $f[0] eq 'CC' || $f[0] eq 'COPY') {
+               my $i = 1;
+               my $rr = '0';
+               if (uc $f[$i] eq 'RR') {
+                       $rr = '1';
+                       $i++;
+               }
+               my $oref = DXMsg::get($f[$i]);
+               #return (0, $self->msg('esend1', $f[$i])) if !$oref;
+               #return (0, $self->msg('esend2')) if $i+1 >  @f;
+               return (0, "msgno $f[$i] not found") if !$oref;
+               return (0, "need a callsign") if $i+1 >  @f;
       
-       # separate copy to everyone listed
-       for ($i++ ; $i < @f; $i++) {
-         my $msgno = DXMsg::next_transno('Msgno');
-         my $newsubj = "CC: " . $oref->subject;
-         my $nref = DXMsg->alloc($msgno, 
-                                 uc $f[$i], 
-                                 $self->call,  
-                                                         $main::systime, 
-                                                         '1',  
-                                                         $newsubj, 
-                                                         $main::mycall,
-                                                         '0',
-                                                         $rr);
-         my @list;
-         my $from = $oref->from;
-         my $to = $oref->to;
-         my $date = cldate($oref->t);
-         my $time = ztime($oref->t);
-         my $buf = "Original from: $from To: $to Date: $date $time";
-         push @list, $buf; 
-         push @list, $oref->read_msg_body();
-         $nref->store(\@list);
-         $nref->add_dir();
-         #push @out, $self->msg('sendcc', $oref->msgno, $f[$i]);
-         push @out, "copy of msg $oref->{msgno} sent to $to";
+               # separate copy to everyone listed
+               for ($i++ ; $i < @f; $i++) {
+                       my $msgno = DXMsg::next_transno('Msgno');
+                       my $newsubj = "CC: " . $oref->subject;
+                       my $nref = DXMsg->alloc($msgno, 
+                                                                       uc $f[$i], 
+                                                                       $self->call,  
+                                                                       $main::systime, 
+                                                                       '1',  
+                                                                       $newsubj, 
+                                                                       $main::mycall,
+                                                                       '0',
+                                                                       $rr);
+                       my @list;
+                       my $from = $oref->from;
+                       my $to = $oref->to;
+                       my $date = cldate($oref->t);
+                       my $time = ztime($oref->t);
+                       my $buf = "Original from: $from To: $to Date: $date $time";
+                       push @list, $buf; 
+                       push @list, $oref->read_msg_body();
+                       $nref->store(\@list);
+                       $nref->add_dir();
+                       #push @out, $self->msg('sendcc', $oref->msgno, $f[$i]);
+                       push @out, "copy of msg $oref->{msgno} sent to $to";
+               }
+               DXMsg::queue_msg();
+               return (1, @out);
        }
-       DXMsg::queue_msg();
-       return (1, @out);
-  }
 
-  # now deal with real message inputs 
-  # parse out send line for various possibilities
-  $loc = $self->{loc} = {};
+       # now deal with real message inputs 
+       # parse out send line for various possibilities
+       $loc = $self->{loc} = {};
   
-  my $i = 0;
-  $f[0] = uc $f[0];
-  $loc->{private} = '1';
-  if ($f[0] eq 'B' || $f[0] =~ /^NOP/oi) {
-    $loc->{private} = '0';
-       $i += 1;
-  } elsif ($f[0] eq 'P' || $f[0] =~ /^PRI/oi) {
-    $i += 1;
-  }
+       my $i = 0;
+       $f[0] = uc $f[0];
+       $loc->{private} = '1';
+       if ($f[0] eq 'B' || $f[0] =~ /^NOP/oi) {
+               $loc->{private} = '0';
+               $i += 1;
+       } elsif ($f[0] eq 'P' || $f[0] =~ /^PRI/oi) {
+               $i += 1;
+       }
   
-  $loc->{rrreq} = '0';
-  if (uc $f[$i] eq 'RR') {
-    $loc->{rrreq} = '1';
-       $i++;
-  }
+       $loc->{rrreq} = '0';
+       if (uc $f[$i] eq 'RR') {
+               $loc->{rrreq} = '1';
+               $i++;
+       }
   
-  # check we have some callsigns
-  if ($i  >=  @f) {
-    delete $self->{loc};
-       return (1, $self->msg('e6'));
-  }
+       # check we have some callsigns
+       if ($i  >=  @f) {
+               delete $self->{loc};
+               return (1, $self->msg('e6'));
+       }
   
-  # now save all the 'to' callsigns for later
-  my @to = @f[ $i..$#f ];
-  $loc->{to} = \@to;
+       # now save all the 'to' callsigns for later
+       my @to = map {uc $_} @f[ $i..$#f ];
+       $loc->{to} = \@to;
 
-  # find me and set the state and the function on my state variable to
-  # keep calling me for every line until I relinquish control
-  $self->func("DXMsg::do_send_stuff");
-  $self->state('send1');
-  #push @out, $self->msg('sendsubj');
-  push @out, "Enter Subject (30 characters) >";
+       # find me and set the state and the function on my state variable to
+       # keep calling me for every line until I relinquish control
+       $self->func("DXMsg::do_send_stuff");
+       $self->state('send1');
+       #push @out, $self->msg('sendsubj');
+       push @out, "Enter Subject (30 characters) >";
 }
 
 return (1, @out);
diff --git a/perl/Database.pm b/perl/Database.pm
new file mode 100644 (file)
index 0000000..e69de29
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..bc622e36490c1faa4a0050b4e208cbe9ba2dc9a2 100644 (file)
@@ -0,0 +1,43 @@
+#
+# The User/Sysop Filter module
+#
+# The way this works is that the filter routine is actually
+# a predefined function that returns 0 if it is OK and 1 if it
+# is not when presented with a list of things.
+#
+# This set of routines provide a means of maintaining the filter
+# scripts which are compiled in when an entity connects.
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+
+package Filter;
+
+use DXVars;
+use DXUtils;
+use DXDebug;
+
+# initial filter system
+sub init
+{
+}
+
+sub compile
+{
+
+}
+
+
+
+
+
+
+
+
+
+
+
+1;
+__END__
index 30f815418acdc00d3d640ac3aa2ee3050985483a..5341a919a6c4f9bd16d12b2ac3e7eaa11a152258 100755 (executable)
@@ -49,7 +49,7 @@ package main;
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
-$version = "1.22";                             # the version no of the software
+$version = "1.23";                             # the version no of the software
 $starttime = 0;                 # the starting time of the cluster   
  
 # handle disconnections