]> scm.dxcluster.org Git - spider.git/blob - cmd/disconnect.pl
9207d73b930c5833725821538524e1ac51c242c2
[spider.git] / cmd / disconnect.pl
1 #
2 # disconnect a local user
3 #
4 my ($self, $line) = @_;
5 my @calls = split /\s+/, $line;
6 my $call;
7 my @out;
8
9 if ($self->priv < 5) {
10         return (1, $self->msg('e5'));
11 }
12
13 foreach $call (@calls) {
14         $call = uc $call;
15         next if $call eq $main::mycall;
16         my $dxchan = DXChannel->get($call);
17         if ($dxchan) {
18                 if ($dxchan->is_node) {
19 #                       $dxchan->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', $self->call)));
20                 } else {
21                         return (1, $self->msg('e5')) if $self->priv < 8;
22                         $dxchan->send_now('D', $self->msg('disc1', $self->call));
23                 } 
24                 $dxchan->disconnect;
25                 push @out, $self->msg('disc2', $call);
26         } elsif (my $conn = Msg->call($call)) {
27                 $conn->disconnect;
28         } else {
29                 push @out, $self->msg('e10', $call);
30         }
31 }
32
33 return (1, @out);