if ($is_node) {
my $nref = Route::Node::get($call);
@rout = $nref->del($parent) if $nref;
- dbg("ROUTE: deleted node $call from " . $parent->call) if isdbg('route');
+ dbg("ROUTE: deleting node $call from " . $parent->call) if isdbg('route');
} else {
my $uref = Route::User::get($call);
@rout = $parent->del_user($uref) if $uref;
my ($dnodes, $dusers, $nnodes, $nusers) = $parent->calc_config_changes(\@nodes, \@users);
+ # add users here
foreach my $r (@nent) {
my $call = $r->[0];
if ($call) {
push @radd,_add_thingy($parent, $r) if grep $call eq $_, (@$nnodes, @$nusers);
- push @rdel,_del_thingy($parent, $r) if grep $call eq $_, (@$dnodes, @$dusers);
}
}
+ # del users here
+ foreach my $r (@$dnodes) {
+ push @rdel,_del_thingy($parent, [$r, 1]);
+ }
+ foreach my $r (@$dusers) {
+ push @rdel,_del_thingy($parent, [$r, 0]);
+ }
} else {
dbg("PCPROT: unknown action '$sort', ignored") if isdbg('chanerr');
return;
}
if ($printit) {
- $line = ' ' x ($level*2) . "$call";
- $call = ' ' x length $call;
+ my $pcall = "$call:" . $self->obscount;
+
+ $line = ' ' x ($level*2) . "$pcall";
+ $call = ' ' x length $pcall;
# recursion detector
if ((DXChannel::get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
my %users = map {$_ => 1} @{$self->{users}};
my $cnodes = shift;
my $cusers = shift;
+ if (isdbg('route')) {
+ dbg("ROUTE: start calc_config_changes");
+ dbg("ROUTE: incoming nodes on $self->{call}: " . join(',', sort @$cnodes));
+ dbg("ROUTE: incoming users on $self->{call}: " . join(',', sort @$cusers));
+ dbg("ROUTE: existing nodes on $self->{call}: " . join(',', sort keys %nodes));
+ dbg("ROUTE: existing users on $self->{call}: " . join(',', sort keys %users));
+ }
my (@dnodes, @dusers, @nnodes, @nusers);
push @nnodes, map {my @r = $nodes{$_} ? () : $_; delete $nodes{$_}; @r} @$cnodes;
push @dnodes, keys %nodes;
push @nusers, map {my @r = $users{$_} ? () : $_; delete $users{$_}; @r} @$cusers;
push @dusers, keys %users;
+ if (isdbg('route')) {
+ dbg("ROUTE: deleted nodes on $self->{call}: " . join(',', sort @dnodes));
+ dbg("ROUTE: deleted users on $self->{call}: " . join(',', sort @dusers));
+ dbg("ROUTE: added nodes on $self->{call}: " . join(',', sort @nnodes));
+ dbg("ROUTE: added users on $self->{call}: " . join(',', sort @nusers));
+ dbg("ROUTE: end calc_config_changes");
+ }
return (\@dnodes, \@dusers, \@nnodes, \@nusers);
}