Try to improve PC93 discrimination between talk and chat
authorDirk Koopman <djk@tobit.co.uk>
Tue, 24 Jul 2007 15:38:08 +0000 (16:38 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 24 Jul 2007 15:38:08 +0000 (16:38 +0100)
Changes
perl/DXProt.pm
perl/DXProtHandle.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 45c6ea750c07026b127d36c61bd75d4a8469b0d5..7b64449c6f7ad85eacb583a26bbe78754614ce52 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,10 @@
+24Jul07=======================================================================
+1. Try to target PC93 (the combined talk/ann/chat sentence) better. Prevent
+PC12 chat going to non-dxspider and non-ak1a nodes. None of the others seem to
+handle it correctly (Lee VE7CC: do you?).
+2. a few other tidyups,
+see: http://www.dxcluster.org/cgi-bin/gitweb.cgi?p=spider.git
+for details.
 18Jul07=======================================================================
 1. Change the meaning of set/isolate. Set/isolate now works in both directions
 in that an isolated node will only have its local config remembered and will
index 596f1f08d3a1256d1ddfab84a815b6be674feee3..7ad886fd16bc9f1cc8462077395fb32ec49c14fc 100644 (file)
@@ -783,7 +783,21 @@ sub announce
 
 sub chat
 {
-       goto &announce;
+       my $self = shift;
+       my $line = shift;
+       my $isolate = shift;
+       my $to = shift;
+       my $target = shift;
+       my $text = shift;
+       my ($filter, $hops);
+
+       if ($self->{annfilter}) {
+               ($filter, $hops) = $self->{annfilter}->it(@_);
+               return unless $filter;
+       }
+       if (($self->is_spider || $self->is_ak1a) && $_[1] ne $main::mycall) {
+               send_prot_line($self, $filter, $hops, $isolate, $line);
+       }
 }
 
 
index cd229c0f2d113370a11869e7d06de450efc76edb..831d8885be1918ef565dcb2a64a28196d13e49c1 100644 (file)
@@ -1711,7 +1711,8 @@ sub handle_93
                return;
        }
 
-       # remember that we are converting PC10->PC93
+       # remember that we are converting PC10->PC93 and self will be $main::me if it
+       # comes from us
        unless ($self->{do_pc9x}) {
                dbg("PCPROT: PC9x come in from non-PC9x node, ignored") if isdbg('chanerr');
                return;
@@ -1720,11 +1721,11 @@ sub handle_93
        my $t = $_[2];
        my $parent = check_pc9x_t($pcall, $t, 93, 1) || return;
 
-       my $to = $_[3];
-       my $from = $_[4];
-       my $via = $_[5];
+       my $to = uc $_[3];
+       my $from = uc $_[4];
+       my $via = uc $_[5];
        my $text = $_[6];
-       my $onode = $_[7];
+       my $onode = uc $_[7];
        $onode = $pcall if @_ <= 8;
 
        # this is catch loops caused by bad software ...
@@ -1749,7 +1750,9 @@ sub handle_93
                return;
        }
 
-       if (is_callsign($to)) {
+       # if it is routeable then then treat it like a talk
+       my $ref = Route::get($to);
+       if ($ref) {
                # local talks
                my $dxchan;
                $dxchan = DXChannel::get($main::myalias) if $to eq $main::mycall;
@@ -1767,7 +1770,6 @@ sub handle_93
                }
 
                # convert to PC10 talks where appropriate
-               my $ref = Route::get($to);
                if ($ref) {
                        # just go for the "best" one for now (rather than broadcast)
                        $dxchan = $ref->dxchan;
@@ -1786,15 +1788,15 @@ sub handle_93
                }
 
                # otherwise, drop through and allow it to be broadcast
-       } elsif ($to eq '*' || uc $to eq 'SYSOP' || uc $to eq 'WX') {
+       } elsif ($to eq '*' || $to eq 'SYSOP' || $to eq 'WX') {
                # announces
-               my $sysop = uc $to eq 'SYSOP' ? '*' : ' ';
-               my $wx = uc $to eq 'WX' ? '1' : '0';
+               my $sysop = $to eq 'SYSOP' ? '*' : ' ';
+               my $wx = $to eq 'WX' ? '1' : '0';
                my $local = $via eq 'LOCAL' ? '*' : $via;
 
                $self->send_announce(1, pc12($from, $text, $local, $sysop, $wx, $pcall), $from, $local, $text, $sysop, $pcall, $wx, $via eq 'LOCAL' ? $via : undef);
                return if $via eq 'LOCAL';
-       } else {
+       } elsif (!is_callsign($to) && $text =~ /^#\d+ /) {
                # chat messages to non-pc9x nodes
                $self->send_chat(1, pc12($from, $text, undef, $to, undef, $pcall), $from, '*', $text, $to, $pcall, '0');
        }
index c362730893ff7b111cd9747677edcc155cab7670..f54e69da799738d64054b12871e0604b133bfba9 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '126';
+$build = '127';
 
 1;