fix announces
authorDirk Koopman <djk@tobit.co.uk>
Mon, 25 Jun 2007 17:04:59 +0000 (18:04 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 25 Jun 2007 17:04:59 +0000 (18:04 +0100)
This was caused by double duplication, in turn because I
have moved to having everything done by the pc93 handler.

Changes
cmd/announce.pl
cmd/chat.pl
perl/AnnTalk.pm
perl/DXProt.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 65ebd62784faff5bb9219c1572a352760b88fccf..f0cb65b12d8e4f7aeb738afb56dcae9cd7ad1d13 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 25Jun06=======================================================================
 1. make sure that a C record is sent for node call every update period.
+2. make announces work again (probably).
 24Jun06=======================================================================
 1. Fix the routing algorithms to allow route selection in the face of
 incomplete trees of nodes (trees as produced by sh/newc).
index a3d3fd61718b10a184591041044c1eb9b6fb817a..64abaad6e88e99237a31b66a2ef4471287ad0207 100644 (file)
@@ -16,6 +16,7 @@
 #
 
 my ($self, $line) = @_;
+#$DB::single = 1;
 my @f = split /\s+/, $line;
 return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript;
 return (1, $self->msg('e9')) if !@f;
@@ -64,7 +65,7 @@ if ($drop) {
        return (1, ());
 }
 
-return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line);
+#return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line);
 Log('ann', $to, $from, $line);
 $main::me->normal(DXProt::pc93($to, $from, $via, $line));
 
index 874f6ac1c869aa5058343028ece2030c114282f9..2aa629436e2800af77791e9743ad23600732fa0e 100644 (file)
@@ -40,6 +40,4 @@ $text = "#$msgid $text";
 
 $main::me->normal(DXProt::pc93($target, $from, undef, $text));
 
-#DXProt:):send_chat($self, 1, DXProt::pc12($from, $text, '*', $target), $from, '*', $text, $target, $main::mycall, '0');
-
 return (1, ());
index a38f9cb3b7459a98317da876b61cabd07263f0df..72abfeb283c6bf35b6dbb839f999e3bf96259289 100644 (file)
@@ -18,7 +18,7 @@ use DXVars;
 use vars qw(%dup $duplth $dupage $filterdef);
 
 $duplth = 60;                                  # the length of text to use in the deduping
-$dupage = 5*24*3600;                   # the length of time to hold spot dups
+$dupage = 5*3600;                      # the length of time to hold spot dups
 $filterdef = bless ([
                          # tag, sort, field, priv, special parser 
                          ['by', 'c', 0],
@@ -51,7 +51,7 @@ sub dup
        $text = pack("C*", map {$_ & 127} unpack("C*", $text));
        $text =~ s/[^\#a-zA-Z0-9]//g;
        $text = substr($text, 0, $duplth) if length $text > $duplth; 
-       my $dupkey = "A$to|\L$text";
+       my $dupkey = "A$call|$to|\L$text";
        return DXDupe::check($dupkey, $t);
 }
 
index 18d7bdb5ae4bea70c4adfcea392b8e58a6f9aae4..61693f330ed1659bd37223805efa8a7f80c1cf2e 100644 (file)
@@ -624,6 +624,7 @@ sub send_announce
        my $target = $_[6];
        my $to = 'To ';
        my $text = unpad($_[2]);
+       my $from = $_[0];
 
        if ($_[3] eq '*') {     # sysops
                $target = "SYSOP";
@@ -640,7 +641,7 @@ sub send_announce
 
 
        # obtain country codes etc
-       my @a = Prefix::cty_data($_[0]);
+       my @a = Prefix::cty_data($from);
        my @b = Prefix::cty_data($_[4]);
        if ($self->{inannfilter}) {
                my ($filter, $hops) =
@@ -653,12 +654,20 @@ sub send_announce
                }
        }
 
-       if (AnnTalk::dup($_[0], $_[1], $_[2])) {
-               dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr');
-               return;
+       if (AnnTalk::dup($from, $_[1], $_[2])) {
+               my $dxchan = DXChannel::get($from);
+               if ($dxchan && $dxchan->is_user) {
+                       if ($dxchan->priv < 5) {
+                               $dxchan->send($dxchan->msg('dup'));
+                               return;
+                       }
+               } else {
+                       dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr');
+                       return;
+               }
        }
 
-       Log('ann', $target, $_[0], $text);
+       Log('ann', $target, $from, $text);
 
        # send it if it isn't the except list and isn't isolated and still has a hop count
        # taking into account filtering and so on
@@ -692,6 +701,7 @@ sub send_chat
        my $target = $_[3];
        my $text = unpad($_[2]);
        my $ak1a_line;
+       my $from = $_[0];
 
        # munge the group and recast the line if required
        if ($target =~ s/\.LST$//) {
@@ -699,7 +709,7 @@ sub send_chat
        }
 
        # obtain country codes etc
-       my @a = Prefix::cty_data($_[0]);
+       my @a = Prefix::cty_data($from);
        my @b = Prefix::cty_data($_[4]);
        if ($self->{inannfilter}) {
                my ($filter, $hops) =
@@ -712,13 +722,21 @@ sub send_chat
                }
        }
 
-       if (AnnTalk::dup($_[0], $_[1], $_[2], $chatdupeage)) {
-               dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr');
-               return;
+       if (AnnTalk::dup($from, $target, $_[2], $chatdupeage)) {
+               my $dxchan = DXChannel::get($from);
+               if ($dxchan && $dxchan->is_user) {
+                       if ($dxchan->priv < 5) {
+                               $dxchan->send($dxchan->msg('dup'));
+                               return;
+                       }
+               } else {
+                       dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr');
+                       return;
+               }
        }
 
 
-       Log('chat', $target, $_[0], $text);
+       Log('chat', $target, $from, $text);
 
        # send it if it isn't the except list and isn't isolated and still has a hop count
        # taking into account filtering and so on
index af7281e0e2b9a9cbb39e7fb3ea23c03ff152db25..e13cfe2826d5c5b40956ce6a1127918d2d844b63 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '89';
+$build = '90';
 
 1;