From ec2bc54f842a3b684ce9375511f4ab2098717fe1 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 10 Dec 2021 10:45:23 +0000 Subject: [PATCH] back port registration from mojo --- Changes | 1 + cmd/show/log.pl | 2 +- cmd/show/registered.pl | 6 ++++-- perl/DXChannel.pm | 14 ++++++++++++++ perl/DXCommandmode.pm | 13 ------------- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 1194b5dc..2bf1af04 100644 --- 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. diff --git a/cmd/show/log.pl b/cmd/show/log.pl index 3ff4a50b..f8858583 100644 --- a/cmd/show/log.pl +++ b/cmd/show/log.pl @@ -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) { diff --git a/cmd/show/registered.pl b/cmd/show/registered.pl index 929d014d..d3755324 100644 --- a/cmd/show/registered.pl +++ b/cmd/show/registered.pl @@ -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; diff --git a/perl/DXChannel.pm b/perl/DXChannel.pm index fedaee05..40efdd24 100644 --- a/perl/DXChannel.pm +++ b/perl/DXChannel.pm @@ -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 { diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index cc694cc8..3eb35195 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -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__ -- 2.43.0