From 4040adfd8ddb09ee44827be13c298b11e61e4eb0 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Tue, 30 Apr 2024 17:14:09 +0100 Subject: [PATCH] rearrange priv/lock tests independent of node type --- perl/DXProtHandle.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index dc27225d..ffe91741 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -2205,16 +2205,20 @@ sub handle_92 $user->build($parent->build($build)); ++$changed; } + if ($oldsort ne 'S') { $user->sort('S'); - unless (DXChannel::get($user->call)) { # only do this if not connected - my $oldpriv = $user->priv; - my $oldlock = $user->lockout; - $user->priv(1) unless defined $oldpriv && $oldpriv; - $user->lockout(1) unless defined $oldlock; - dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0); - ++$changed; - } + dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S"); + ++$changed; + } + + unless (DXChannel::get($user->call)) { # only do this if not connected + my $oldpriv = $user->priv; + my $oldlock = $user->lockout; + my $lastchanged = $changed; + $user->priv(1), ++$changed unless defined $oldpriv && $oldpriv; + $user->lockout(1), ++$changed unless defined $oldlock; + dbg(sprintf "PCPROT: PC92 K rec, node $call updated priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0) if $lastchanged != $changed; } unless ($user->K) { dbg(sprintf "PCPROT: PC92 K rec, node $call updated - marked as sending PC92 K records priv: %d lockout: %d ", $user->priv || 0, $user->lockout || 0); -- 2.43.0