1. Added RCMD for clx
[spider.git] / cmd / rcmd.pl
1 #
2 # rcmd command
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my $self = shift;
10 my $line = shift; 
11 my ($call) = $line =~ /^\s*(\S+)/;
12
13 # are we permitted?
14 return (1, $self->msg('e5')) if $self->priv < 6;
15
16 # is there a call?
17 return (1, $self->msg('e6')) unless $call;
18
19 # remove the callsign from the line
20 $line =~ s/^\s*$call\s+//;
21
22 # can we see it? Is it a node?
23 $call = uc $call;
24 my $noderef = DXCluster->get_exact($call);
25 unless ($noderef) {
26         $noderef = DXChannel->get($call);
27         $noderef = undef unless $noderef && $noderef->is_node;
28 }
29 return (1, $self->msg('e7', $call)) unless $noderef;
30
31 # rcmd it
32 DXProt::addrcmd($self, $call, $line);
33
34 return (1, $self->msg('rcmdo', $line, $call));