added a load of eph changes
[spider.git] / cmd / set / here.pl
1 #
2 # set 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(1);
22                 push @out, $self->msg('heres', $call);
23                 if ($ref) {
24                         my $s = DXProt::pc24($ref);
25                         DXProt::eph_dup($s);
26                         DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
27                         $ref->here(1);
28                 } elsif ($ref = Route::Node::get($call)) {
29                         my $s = DXProt::pc24($ref);
30                         DXProt::eph_dup($s);
31                         DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
32                         $ref->here(1);
33                 } else {
34                         $ref = Route::Node::get($call);
35                         $ref->here(1) if $ref;
36                 }
37         } else {
38                 push @out, $self->msg('e3', "Set Here", $call);
39         }
40 }
41
42 return (1, @out);