X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute%2FNode.pm;h=bd69d3d77290947af5089a73484ebc339cddbfe1;hb=069147b7c204d14e826af2478765be15b72ac96d;hp=2350f86f062dacbd0218e8f4a2c53f67a00df042;hpb=eb2a2eb1aa8e7c743c23ec5e0dc5aa40a8708e79;p=spider.git diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index 2350f86f..bd69d3d7 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -58,7 +58,7 @@ sub max # object with that callsign. The upper layers are expected to do something # sensible with this! # -# called as $parent->add(call, dxchan, version, flags) +# called as $parent->add(call, version, flags) # sub add @@ -66,13 +66,21 @@ sub add my $parent = shift; my $call = uc shift; confess "Route::add trying to add $call to myself" if $call eq $parent->{call}; + my $version = shift; + my $here = shift; + my $self = get($call); if ($self) { $self->_addparent($parent); $parent->_addnode($self); + if ($self->{version} != $version || $self->{flags} != $here) { + $self->{version} = $version; + $self->{flags} = $here; + return $self; + } return undef; } - $self = $parent->new($call, @_); + $self = $parent->new($call, $version, $here); $parent->_addnode($self); return $self; } @@ -141,10 +149,10 @@ sub add_user my $uref = Route::User::get($ucall); my @out; if ($uref) { - @out = $uref->addparent($self); + push @out, $uref->addparent($self); } else { $uref = Route::User->new($ucall, $self->{call}, @_); - @out = $uref; + push @out, $uref; } $self->_adduser($uref); $self->{usercount} = scalar @{$self->{users}};