From 79940e262f4585376cfed8bcdbaaff57c6b98eae Mon Sep 17 00:00:00 2001 From: djk Date: Mon, 18 Jan 1999 12:13:37 +0000 Subject: [PATCH] UPPER CASED all the callsigns on send added Filter.pm and Database.pm --- Changes | 8 +++ cmd/send.pl | 152 +++++++++++++++++++++++------------------------ perl/Database.pm | 0 perl/Filter.pm | 43 ++++++++++++++ perl/cluster.pl | 2 +- 5 files changed, 128 insertions(+), 77 deletions(-) create mode 100644 perl/Database.pm diff --git a/Changes b/Changes index 864196b1..cb3bb254 100644 --- 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 ...) diff --git a/cmd/send.pl b/cmd/send.pl index 959a8101..9717c3af 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -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 index 00000000..e69de29b diff --git a/perl/Filter.pm b/perl/Filter.pm index e69de29b..bc622e36 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -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__ diff --git a/perl/cluster.pl b/perl/cluster.pl index 30f81541..5341a919 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -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 -- 2.43.0