started the addition of help files
[spider.git] / cmd / talk.pl
1 #
2 # The talk command
3 #
4 # Copyright (c) 1998 Dirk Koopman G1TLH
5 #
6 # $Id$
7 #
8
9 my ($self, $line) = @_;
10 my @argv = split /\s+/, $line;                # generate an argv
11 my $to = uc $argv[0];
12 my $via;
13 my $from = $self->call();
14
15 if ($argv[1] eq '>') {
16   $via = uc $argv[2];
17   $line =~ s/^$argv[0]\s+>\s+$argv[2]\s*//;
18 } else {
19   $line =~ s/^$argv[0]\s*//;
20 }
21
22 my $dxchan = DXCommandmode->get($to);         # is it for us?
23 if ($dxchan && $dxchan->is_user) {
24   $dxchan->send("$to de $from $line");
25 } else {
26   $line =~ s/\^//og;            # remove any ^ characters
27   my $prot = DXProt::pc10($from, $to, $via, $line);
28   DXProt::route($via?$via:$to, $prot);
29 }
30
31 return (1, ());
32