X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fhomenode.pl;h=cf8d97154d60a0316359452bd061c0b65554380a;hb=a9cff23c7050696bfe1dee906157416c49739f07;hp=2c7c6c9f65d0340720ba240f199bd5e10af8bc5d;hpb=099c6b4a10d9f1e7471b0c94273cd992b5814cdc;p=spider.git diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index 2c7c6c9f..cf8d9715 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -5,3 +5,28 @@ # # $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 $line; + $user->homenode($line); + $user->put(); + my $s = DXProt::pc41($call, 4, $line); + DXProt::eph_dup($s); + DXProt::broadcast_all_ak1a($s, $DXProt::me) ; + return (1, $self->msg('hnode', $line)); +} else { + return (1, $self->msg('namee2', $call)); +} +