From 661d49731a7ac57ce2883ef5d757c7a8144fb6ff Mon Sep 17 00:00:00 2001 From: djk Date: Fri, 10 Dec 1999 22:21:02 +0000 Subject: [PATCH] added mark messages as read or unread --- Changes | 12 +++++ cmd/Commands_en.hlp | 2 + cmd/msg.pl | 14 +++++- cmd/set/node.pl | 1 + cmd/show/dx.pl | 2 +- data/bands.pl | 6 ++- perl/Bands.pm | 110 ++++++++++++++++++++++---------------------- perl/Messages | 1 + perl/cluster.pl | 2 +- 9 files changed, 90 insertions(+), 60 deletions(-) diff --git a/Changes b/Changes index 17880093..db380399 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,15 @@ +10Dec99======================================================================= +1. allow msgs to marked as read or unread +02Dec99======================================================================= +1. DX command doesn't recognise '6M' as '6m' in SH/DX ON 6M. +2. set/node now sets the homenode as the callsign. +3. changed the label for the 18Mhz band from '18m' to '17m' in the bands +table. +01Dec99======================================================================= +1. started the callbot which lives at n2tly.dxcluster.net 9000. +2. added www.qrz.com +3. added www.buck.com +4. added k4ute at no4j.com 28Nov99======================================================================= 1. fixed all the stupid errors introduced in 1.36 confusing DXUser->get with DXCluster->get_exact. diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index ce9d426f..cef3c5da 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -296,6 +296,8 @@ out. MSG NOKEep - unset the keep flag MSG SUbject - change the subject to MSG WAittime - remove any waitting time for this message + MSG NOREad - mark message as unread + MSG REad - mark message as read MSG QUeue - queue any outstanding bulletins MSG QUeue 1 - queue any outstanding private messages diff --git a/cmd/msg.pl b/cmd/msg.pl index 36b75dc7..a1a3df06 100644 --- a/cmd/msg.pl +++ b/cmd/msg.pl @@ -59,6 +59,16 @@ if ($cmd =~ /^to/i) { $old = $ref->private ? 'P' : 'B'; $new = 'B'; $ref->private(0); +} elsif ($cmd =~ /^re/i) { + $m = 'Msg Type'; + $old = $ref->read ? 'Read' : 'Unread'; + $new = 'Read'; + $ref->read(1); +} elsif ($cmd =~ /^(nore|unre)/i) { + $m = 'Msg Type'; + $old = $ref->read ? 'Read' : 'Unread'; + $new = 'Unread'; + $ref->read(0); } elsif ($cmd =~ /^rr/i) { $m = 'RR Req'; $old = $ref->rrreq ? 'RR Req' : 'No RR Req'; @@ -88,7 +98,9 @@ if ($cmd =~ /^to/i) { $old = cldatetime($ref->waitt) || 'None'; $new = 'None'; $ref->waitt(0); -} +} else { + return (1, $self->msg('e15', $cmd)); +} # store changes and return $ref->store( [ $ref->read_msg_body() ] ); diff --git a/cmd/set/node.pl b/cmd/set/node.pl index 2a8c1479..0895b20c 100644 --- a/cmd/set/node.pl +++ b/cmd/set/node.pl @@ -28,6 +28,7 @@ foreach $call (@args) { $user = DXUser->new($call) if $create; if ($user) { $user->sort('A'); + $user->homenode($call); $user->close(); push @out, $self->msg($create ? 'nodec' : 'node', $call); } else { diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index 2af75e7c..b10ee7cd 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -32,7 +32,7 @@ while ($f = shift @list) { # next field } if (lc $f eq 'on' && $list[0]) { # is it freq range? # print "yup freq\n"; - my @r = split '/', $list[0]; + my @r = split '/', lc $list[0]; # print "r0: $r[0] r1: $r[1]\n"; my @fr = Bands::get_freq($r[0], $r[1]); if (@fr) { # yup, get rid of extranous param diff --git a/data/bands.pl b/data/bands.pl index 4e64a38a..bb361258 100644 --- a/data/bands.pl +++ b/data/bands.pl @@ -10,6 +10,8 @@ # There MUST be at last a 'band' entry # # It is up to YOU to make sure that it makes sense! +# +# ALL the labels MUST BE in lower case. # @@ -17,7 +19,7 @@ '73khz' => bless ( { band => [71, 75], }, 'Bands'), - '136Khz' => bless ( { band => [135, 138], + '136khz' => bless ( { band => [135, 138], }, 'Bands'), '160m' => bless( { band => [ 1800, 2000 ], @@ -52,7 +54,7 @@ data => [ 14070, 14098, 14101, 14111 ], }, 'Bands'), - '18m' => bless( { band => [ 18068, 18168 ], + '17m' => bless( { band => [ 18068, 18168 ], cw => [ 18068, 18100 ], ssb => [ 18111, 18168 ], data => [ 18101, 18108], diff --git a/perl/Bands.pm b/perl/Bands.pm index 55ac154c..7e67a60e 100644 --- a/perl/Bands.pm +++ b/perl/Bands.pm @@ -16,72 +16,72 @@ use Carp; use strict; use vars qw(%bands %regions %aliases $bandsfn %valid); -%bands = (); # the 'raw' band data -%regions = (); # list of regions for shortcuts eg vhf ssb -%aliases = (); # list of aliases +%bands = (); # the 'raw' band data +%regions = (); # list of regions for shortcuts eg vhf ssb +%aliases = (); # list of aliases $bandsfn = "$main::data/bands.pl"; %valid = ( - cw => '0,CW,parraypairs', - ssb => '0,SSB,parraypairs', - data => '0,DATA,parraypairs', - sstv => '0,SSTV,parraypairs', - fstv => '0,FSTV,parraypairs', - rtty => '0,RTTY,parraypairs', - pactor => '0,PACTOR,parraypairs', - packet => '0,PACKET,parraypairs', - repeater => '0,REPEATER,parraypairs', - fax => '0,FAX,parraypairs', - beacon => '0,BEACON,parraypairs', - band => '0,BAND,parraypairs', -); + cw => '0,CW,parraypairs', + ssb => '0,SSB,parraypairs', + data => '0,DATA,parraypairs', + sstv => '0,SSTV,parraypairs', + fstv => '0,FSTV,parraypairs', + rtty => '0,RTTY,parraypairs', + pactor => '0,PACTOR,parraypairs', + packet => '0,PACKET,parraypairs', + repeater => '0,REPEATER,parraypairs', + fax => '0,FAX,parraypairs', + beacon => '0,BEACON,parraypairs', + band => '0,BAND,parraypairs', + ); # load the band data sub load { - %bands = (); - do $bandsfn; - confess $@ if $@; + %bands = (); + do $bandsfn; + confess $@ if $@; } # obtain a band object by callsign [$obj = Band::get($call)] sub get { - my $call = shift; - my $ncall = $aliases{$call}; - $call = $ncall if $ncall; - return $bands{$call}; + my $call = shift; + my $ncall = $aliases{$call}; + $call = $ncall if $ncall; + return $bands{$call}; } # obtain all the band objects sub get_all { - return values(%bands); + return values(%bands); } # get all the band keys sub get_keys { - return keys(%bands); + return keys(%bands); } # get all the region keys sub get_region_keys { - return keys(%regions); + return keys(%regions); } # get all the alias keys sub get_alias_keys { - return keys(%aliases); + return keys(%aliases); } # get a region sub get_region { - my $reg = shift; - return $regions{$reg}; + my $reg = shift; + return $regions{$reg}; } # get all the frequency pairs associated with the band and sub-band offered @@ -90,27 +90,27 @@ sub get_region # called Bands::get_freq(band-label, subband-label) sub get_freq { - my ($band, $subband) = @_; - my @band; - my $b; - my @out; - return () if !$band; - $subband = 'band' if !$subband; + my ($band, $subband) = @_; + my @band; + my $b; + my @out; + return () if !$band; + $subband = 'band' if !$subband; - # first look in the region - $b = $regions{$band}; - @band = @$b if $b; - @band = ($band) if @band == 0; + # first look in the region + $b = $regions{$band}; + @band = @$b if $b; + @band = ($band) if @band == 0; - # we now have a list of bands to scan for sub bands - foreach $b (@band) { - my $wb = $bands{$b}; - if ($wb) { - my $sb = $wb->{$subband}; - push @out, @$sb if $sb; + # we now have a list of bands to scan for sub bands + foreach $b (@band) { + my $wb = $bands{$b}; + if ($wb) { + my $sb = $wb->{$subband}; + push @out, @$sb if $sb; + } } - } - return @out; + return @out; } # @@ -119,7 +119,7 @@ sub get_freq sub fields { - return keys(%valid); + return keys(%valid); } # @@ -128,19 +128,19 @@ sub fields sub field_prompt { - my ($self, $ele) = @_; - return $valid{$ele}; + my ($self, $ele) = @_; + return $valid{$ele}; } no strict; sub AUTOLOAD { - my $self = shift; - my $name = $AUTOLOAD; - return if $name =~ /::DESTROY$/; - $name =~ s/.*:://o; + my $self = shift; + my $name = $AUTOLOAD; + return if $name =~ /::DESTROY$/; + $name =~ s/.*:://o; - @_ ? $self->{$name} = shift : $self->{$name} ; + @_ ? $self->{$name} = shift : $self->{$name} ; } 1; diff --git a/perl/Messages b/perl/Messages index 7fa5be92..54813c27 100644 --- a/perl/Messages +++ b/perl/Messages @@ -54,6 +54,7 @@ package DXM; e12 => 'Need a node callsign', e13 => '$_[0] is not a node', e14 => 'First argument must be numeric and > 0', + e15 => 'invalid qualifier \"$_[0]\"', emaile1 => 'Please enter your email address, set/email ', emaila => 'Your E-Mail Address is now \"$_[0]\"', diff --git a/perl/cluster.pl b/perl/cluster.pl index a84918bd..4f88ef02 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -70,7 +70,7 @@ package main; @inqueue = (); # the main input queue, an array of hashes $systime = 0; # the time now (in seconds) -$version = "1.37"; # the version no of the software +$version = "1.38"; # the version no of the software $starttime = 0; # the starting time of the cluster $lockfn = "cluster.lock"; # lock file name @outstanding_connects = (); # list of outstanding connects -- 2.34.1