made ssids unique everywhere
[spider.git] / cmd / talk.pl
index e94fd0250e30cf262671082438df449fe666cad4..827ff672d3a26210af2e95aabe8ddabc0f53a6ff 100644 (file)
@@ -24,12 +24,14 @@ if ($argv[1] eq '>') {
 }
 
 my $call = $via ? $via : $to;
-my $ref = DXCluster->get($call);
+my $ref = DXCluster->get_exact($call);     # try an exact call
+$ref = DXCluster->get($call) unless $ref;  # try one ignoring SSID
+$ref = DXChannel->get($call) unless $ref;  # is it local?
 
 # if we haven't got an explicit via and we can't see them, try their node
 unless ($ref || $via) {
        my $user = DXUser->get($call);
-       $ref = DXCluster->get_exact($user->node);
+       $ref = DXCluster->get_exact($user->node) if $user;
        if ($ref) {
                $via = $user->node;
                push @out, "trying via $via..";
@@ -42,12 +44,12 @@ $line =~ s/\^/:/og;
 
 my $dxchan = DXCommandmode->get($to); # is it for us?
 if ($dxchan && $dxchan->is_user) {
-       $dxchan->send("$to de $from $line");
+       $dxchan->send("$to de $from $line") if $dxchan->talk;
        Log('talk', $to, $from, $main::mycall, $line);
 } else {
        $line =~ s/\^//og;                      # remove any ^ characters
        my $prot = DXProt::pc10($from, $to, $via, $line);
-       DXProt::route($via?$via:$to, $prot);
+       DXProt::route(undef,$via?$via:$to, $prot);
        Log('talk', $to, $from, $via?$via:$main::mycall, $line);
 }