fix a load of missing things
[spider.git] / cmd / unset / here.pl
1 #
2 # unset the here flag
3 #
4 # Copyright (c) 1998 - Dirk Koopman
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @args = split /\s+/, $line;
11 my $call;
12 my @out;
13
14 @args = $self->call if (!@args || $self->priv < 9);
15
16 foreach $call (@args) {
17         $call = uc $call;
18         my $dxchan = DXChannel->get($call);
19         my $ref = Route::User::get($call);
20         if ($dxchan) {
21                 $dxchan->here(0);
22                 push @out, $self->msg('hereu', $call);
23                 if ($ref) {
24                         DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
25                         $ref->here(0);
26                 } elsif ($ref = Route::Node::get($call)) {
27                         DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
28                         $ref->here(0);
29                 } else {
30                         $ref = Route::Node::get($call);
31                         $ref->here(0) if $ref;
32                 }
33         } else {
34                 push @out, $self->msg('e3', "Unset Here", $call);
35         }
36 }
37
38 return (1, @out);