X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fhomenode.pl;h=f2f8e6e7cbe7e432fec918ba25fea6b325d29f82;hb=refs%2Fheads%2Fstaging;hp=2c7c6c9f65d0340720ba240f199bd5e10af8bc5d;hpb=099c6b4a10d9f1e7471b0c94273cd992b5814cdc;p=spider.git diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index 2c7c6c9f..f2f8e6e7 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -3,5 +3,32 @@ # # Copyright (c) 1998 - Dirk Koopman G1TLH # -# $Id$ # +# + +my ($self, $line) = @_; +my $call = $self->call; +my $user; + +# remove leading and trailing spaces +$line =~ s/^\s+//; +$line =~ s/\s+$//; +$line =~ s/[{}]//g; # no braces allowed + +return (1, $self->msg('hnodee1')) if !$line; + +$user = DXUser::get_current($call); +if ($user) { + $line = uc unpad($line); + if ($user->homenode && $line ne $user->homenode) { + $user->homenode($line); + $user->put(); + my $s = DXProt::pc41($call, 4, $line); + DXProt::eph_dup($s); + DXChannel::broadcast_all_nodes($s, $main::me); + } + return (1, $self->msg('hnode', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +