added unset/hops command
authorminima <minima>
Sat, 8 Dec 2001 13:42:25 +0000 (13:42 +0000)
committerminima <minima>
Sat, 8 Dec 2001 13:42:25 +0000 (13:42 +0000)
Changes
cmd/Commands_en.hlp
cmd/unset/hops.pl [new file with mode: 0644]
perl/Messages

diff --git a/Changes b/Changes
index 8626bd5a46f1c83a515943aa3254c103bb5e1b94..1eec9db38f833bd741114181c43a22b44902cc80 100644 (file)
--- 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.
index 8e9d381713cba06d11b62034e6a7458d1158696a..d04f9fa8bfb2ed9dec77d0fe14792ef3afa8e7ff 100644 (file)
@@ -1238,6 +1238,7 @@ eg:-
   SET/HOMENODE gb7djk
 
 === 8^SET/HOPS <call> ann|spots|route|wwv|wcy <n>^Set hop count  
+=== 8^UNSET/HOPS <call> 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 (file)
index 0000000..60668d1
--- /dev/null
@@ -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));
index 92fe59aaefd92c08f79787838125930b36167fd7..e5a123fc4013fdcc6a0789e256150a1f6dbc0dd7 100644 (file)
@@ -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 <call> 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]',