back port registration from mojo
authorDirk Koopman <djk@tobit.co.uk>
Fri, 10 Dec 2021 10:45:23 +0000 (10:45 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Fri, 10 Dec 2021 10:45:23 +0000 (10:45 +0000)
Changes
cmd/show/log.pl
cmd/show/registered.pl
perl/DXChannel.pm
perl/DXCommandmode.pm

diff --git a/Changes b/Changes
index 1194b5dcd7b97a3fc86d5b658705ba1c06302ada..2bf1af042096988aa7f42d70703b2c7e32ae0e6b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 08Dec21=======================================================================
 1. Backport console.pl scrolling and width management changes.
+2. Backport show/registered cmd format from mojo.
 06Dec21=======================================================================
 1. Fix show/register to allow query of individual calls as well as get a 
    complete list.
index 3ff4a50b25dfab2f55027caff8ebe7aba5bec1db..f8858583cecba50832ea85574bddd257ccd3cfd6 100644 (file)
@@ -21,7 +21,7 @@ while ($f = shift @f) {                 # next field
                next if $from && $to > $from;
        }
        unless ($to) {
-               ($to) = $f =~ /^(\d+)$/o if !$to;              # is it a to count?
+               ($to) = $f =~ /^(\d+)$/ if !$to;              # is it a to count?
                next if $to;
        }
        unless ($who) {
index 929d014da692765bd5b4075a85029812afab03be..d375532462f5e2158fcf4c8c0082199c083581d8 100644 (file)
@@ -36,13 +36,15 @@ unless (keys %call) {
 
 foreach $key (sort keys %call) {
        my $u = DXUser::get_current($key);
-       if ($u && $u->registered) {
-               push @val, $key;
+       if ($u && defined (my $r = $u->registered)) {
+               push @val, "${key}($r)";
                ++$count;
        }
+       
 }
 
 my @l;
+push @out, "Registration is " . ($main::reqreg ? "Required" :  "NOT Required");
 foreach my $call (@val) {
        if (@l >= 5) {
                push @out, sprintf "%-12s %-12s %-12s %-12s %-12s", @l;
index fedaee056d4815807f744748297b7b786f322300..40efdd245c5445be1e4c4c1fd06f81dac31267a0 100644 (file)
@@ -746,6 +746,20 @@ sub handle_xml
        return $r;
 }
 
+sub registered
+{
+       my $self = shift;
+
+       # the sysop is registered!
+       return 1 if $self->call eq $main::myalias || $self->call eq $main::mycall;
+       
+       if ($main::reqreg) {
+               return $self->{registered};
+       } else {
+               return 1;
+       }
+}
+
 #no strict;
 sub AUTOLOAD
 {
index cc694cc8821a970ad5bdcc217d7f7a84ccb3a1fe..3eb351951c628c705b6c6d0a79cb57323809e0ac 100644 (file)
@@ -1251,19 +1251,6 @@ sub send_motd
        $self->send_file($motd) if -e $motd;
 }
 
-sub registered
-{
-       my $self = shift;
-
-       # the sysop is registered!
-       return 1 if $self->call eq $main::myalias || $self->call eq $main::mycall;
-       
-       if ($main::reqreg) {
-               return $self->{registered};
-       } else {
-               return 1;
-       }
-}
 
 1;
 __END__