From 5d62f7388769bf5ed602209cabf1386ef27aca86 Mon Sep 17 00:00:00 2001 From: minima Date: Sat, 8 Dec 2001 13:42:25 +0000 Subject: [PATCH] added unset/hops command --- Changes | 2 ++ cmd/Commands_en.hlp | 7 +++++++ cmd/unset/hops.pl | 33 +++++++++++++++++++++++++++++++++ perl/Messages | 2 ++ 4 files changed, 44 insertions(+) create mode 100644 cmd/unset/hops.pl diff --git a/Changes b/Changes index 8626bd5a..1eec9db3 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +08Dec01======================================================================= +1. added unset/hops command 02Dec01======================================================================= 1. Fix spurious 'new message for you' messages if things are deleted but unread. diff --git a/cmd/Commands_en.hlp b/cmd/Commands_en.hlp index 8e9d3817..d04f9fa8 100644 --- a/cmd/Commands_en.hlp +++ b/cmd/Commands_en.hlp @@ -1238,6 +1238,7 @@ eg:- SET/HOMENODE gb7djk === 8^SET/HOPS ann|spots|route|wwv|wcy ^Set hop count +=== 8^UNSET/HOPS ann|spots|route|wwv|wcy^Unset hop count Set the hop count for a particular type of broadcast for a node. This command allows you to set up special hop counts for a node @@ -1250,6 +1251,12 @@ eg: Set SHOW/HOPS for information on what is already set. This command creates a filter and works in conjunction with the filter system. +You can unset the hops with command UNSET/HOPS. For example:- + + unset/hops gb7djk ann + unset/hops gb7mbc spots + + === 9^SET/ISOLATE^Isolate a node from the rest of the network Connect a node to your system in such a way that you are a full protocol member of its network and can see all spots on it, but nothing either leaks diff --git a/cmd/unset/hops.pl b/cmd/unset/hops.pl new file mode 100644 index 00000000..60668d10 --- /dev/null +++ b/cmd/unset/hops.pl @@ -0,0 +1,33 @@ +# +# unset/hops commands +# +# Copyright (c) 2000 Dirk Koopman G1TLH +# +# $Id$ +# +my ($self, $line) = @_; +return (0, $self->msg('e5')) if $self->priv < 8; + +my @f = split /\s+/, $line; +my @out; +my $call; + +if (is_callsign(uc $f[0])) { + $call = uc shift @f; +} elsif ($f[0] eq 'node_default' || $f[0] eq 'user_default') { + $call = shift @f; +} + +my $sort = lc shift @f if $f[0] =~ /^ann|spots|wwv|wcy|route$/i; + +return (0, $self->msg('unsethop1')) unless $call && $sort; + +my $ref = Filter::read_in($sort, $call, 0); +$ref = Filter->new($sort, $call, 0) if !$ref || $ref->isa('Filter::Old'); +return (0, $self->msg('filter5', '', $sort, $call)) unless $ref; + +delete $ref->{hops}; +$ref->write; +$ref->install; + +return (0, $self->msg('unsethop2', $sort, $call)); diff --git a/perl/Messages b/perl/Messages index 92fe59aa..e5a123fc 100644 --- a/perl/Messages +++ b/perl/Messages @@ -264,6 +264,8 @@ package DXM; talknh => 'Sorry $_[0] is not online at the moment', talkprompt => 'Talk ($_[0])>', talkstart => 'Starting talking to you', + unsethop1 => 'usage: unset/hops ann|spots|wwv|wcy', + unsethop2 => 'hops unset on $_[1] for $_[0]', usernf => '*** User record for $_[0] not found ***', wwvs => 'WWV flag set on $_[0]', wwvu => 'WWV flag unset on $_[0]', -- 2.34.1