add disc users|nodes|all to disconnect cmd
authorDirk Koopman <djk@tobit.co.uk>
Tue, 13 May 2008 11:53:47 +0000 (12:53 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 13 May 2008 11:53:47 +0000 (12:53 +0100)
Changes
cmd/Commands_en.hlp
cmd/disconnect.pl
perl/DXChannel.pm
perl/Version.pm

diff --git a/Changes b/Changes
index f7335648c23ce102434265475c3bad267add7ace..8bc70051786495b97fb85571847fd235e3d5edae 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+13May08=======================================================================
+1. add disc users|nodes|all so that each of these classes can be disconnected
+in one command. From a request by Mauro IV3SCP.
 12May08=======================================================================
 1. add 'exact' keyword on sh/dx to allow for an exact match to a callsign.
 From a request by Robert HB9DZA.
index a1ab2305bbf944d3e4aa9e612a6801034d689f52..d0cce0dad187b19a3d9dbce63b6a58afe6999172 100644 (file)
@@ -583,8 +583,20 @@ You can abbreviate all the commands to one letter and use ak1a syntax:-
 === 5^DIRECTORY-^
 Sysops can see all users' messages.
 
-=== 8^DISCONNECT <call> [<call> ...]^Disconnect a user or cluster
-Disconnect any <call> connected locally
+=== 8^DISCONNECT <call> [<call> ...]^Disconnect user(s) or node(s)
+Disconnect any <call> connected locally.
+
+In addition you can disconnect all users (except yourself) with
+
+  DISC users
+
+or all nodes with:
+
+  DISC nodes
+
+or everything (except yourself) with
+
+  DISC all
 
 === 0^DX [BY <call>] <freq> <call> <remarks>^Send a DX spot
 This is how you send a DX Spot to other users. You can, in fact, now
index 60078704f375994a29a8c5c8b87aeef3b0e9cb6b..7dad27bb31b3703e303782b66e04fbcdada61830 100644 (file)
@@ -10,6 +10,13 @@ if ($self->priv < 5) {
        return (1, $self->msg('e5'));
 }
 
+if ($calls[0] =~ /^user/i ) {
+       @calls = grep {$_ ne $self->call} DXChannel::get_all_user_calls();
+} elsif ($calls[0] =~ /^node/i) {
+       @calls = grep {$_ ne $main::mycall} DXChannel::get_all_node_calls();
+} elsif (lc $calls[0] eq 'all') {
+       @calls = grep {$_ ne $main::mycall && $_ ne $self->call} DXChannel::get_all_node_calls(), DXChannel::get_all_user_calls();
+}
 foreach $call (@calls) {
        $call = uc $call;
        next if $call eq $main::mycall;
index fcc230aa324b25238535084697d473b1cfdf60a1..69a72abe9e1d4438118f991b5e3b86f515206099 100644 (file)
@@ -239,6 +239,17 @@ sub get_all_nodes
        return @out;
 }
 
+# return a list of node calls
+sub get_all_node_calls
+{
+       my $ref;
+       my @out;
+       foreach $ref (values %channels) {
+               push @out, $ref->{call} if $ref->is_node;
+       }
+       return @out;
+}
+
 # return a list of all users
 sub get_all_users
 {
index 219b248611a8272c63a08c18ebcde25120cda747..62a39ba877dc6e05e9ffbb7e41f62a972fafe859 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.55';
 $subversion = '0';
-$build = '7';
+$build = '8';
 
 1;