X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fset%2Fhomenode.pl;h=605c0c21063f4b9c07771542edf508e4bba3a95e;hb=ab811a0c902225075a9bd69749f65594079433a9;hp=2c7c6c9f65d0340720ba240f199bd5e10af8bc5d;hpb=099c6b4a10d9f1e7471b0c94273cd992b5814cdc;p=spider.git diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index 2c7c6c9f..605c0c21 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -3,5 +3,30 @@ # # 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 $line; + $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)); +} +