$self->send(pc22());
$self->state('normal');
$self->{lastping} = 0;
+ my $thing = Thingy::Rt->new(user=>$self->{call});
+ my $nref = Route::Node::get($self->{call});
+ $thing->broadcast if $thing->copy_pc16_data($nref);
}
# delete a cluster from the list
my $origin = shift;
$self->state('normal');
$self->{lastping} = 0;
+ my $thing = Thingy::Rt->new(user=>$self->{call});
+ my $nref = Route::Node::get($self->{call});
+ $thing->broadcast if $thing->copy_pc16_data($nref);
}
# WWV info
{
my $thing = shift;
my $dxchan = shift;
- my $origin = $thing->{origin};
+ my $origin = $thing->{user} || $thing->{origin};
my $chan_call = $dxchan->{call};
my $parent = Route::Node::get($origin);
unless ($parent) {
- dbg("Thingy::Rt::lcf: received from $origin on $chan_call unknown") if isdbg('chanerr');
+ dbg("Thingy::Rt::cf: received from $thing->{origin}/$origin on $chan_call unknown") if isdbg('chanerr');
return;
}
return $thing;
}
+#
+# copy out the PC16 data for a node into the
+# pc16n and u slots if there are any users
+#
+sub copy_node_pc16_data
+{
+ my $thing = shift;
+ my $uref = shift;
+
+ my @u = $uref->users;
+ if (@u) {
+ $thing->{pc16n} = $uref;
+ $thing->{pc16u} = [map {Route::User::get($_)} @u];
+ return scalar @u;
+ }
+ return undef;
+}
+
sub _add_user
{
my $node = shift;