From 7cf8fad46075f1ca2b8b30475a26a881c031a0ad Mon Sep 17 00:00:00 2001 From: minima Date: Tue, 15 Oct 2002 14:06:43 +0000 Subject: [PATCH 1/1] stop dupe spots from the same user with same details ignoring comment --- Changes | 6 +++--- cmd/dx.pl | 2 +- perl/DXProt.pm | 2 +- perl/Spot.pm | 13 ++++++++----- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 0f60b7dd..d31e0c7e 100644 --- a/Changes +++ b/Changes @@ -19,9 +19,9 @@ is this:- 6a. If you don't have Compress::Zlib loaded then you will need to gunzip it manually and do: create_usdb.pl /tmp/usdbraw (not Windows :-) 7. on linux, in a console window do: load/usdb, on windows: restart the node. - -Added set/usdb command to add adding or changing of a callsign in the USDB - +-- +2. Added set/usdb command to add adding or changing of a callsign in the USDB +3. Stop dupe spots from the same spotter (with or without comment corruption) 14Oct02======================================================================= 1. added show/usdb command as a simple, direct interface to the information available in the USDB stuff. diff --git a/cmd/dx.pl b/cmd/dx.pl index a7dc99ad..eefbb860 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -103,7 +103,7 @@ return (1, @out) unless $valid; # Store it here (but only if it isn't baddx) my $t = (int ($main::systime/60)) * 60; -return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line); +return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line, $spotter); my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall); if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 2bfb9e5e..8437ff78 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -471,7 +471,7 @@ sub normal # this goes after the input filtering, but before the add # so that if it is input filtered, it isn't added to the dup # list. This allows it to come in from a "legitimate" source - if (Spot::dup($field[1], $field[2], $d, $field[5])) { + if (Spot::dup($field[1], $field[2], $d, $field[5], $field[6])) { dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr'); return; } diff --git a/perl/Spot.pm b/perl/Spot.pm index 982f8db5..5c0ce792 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -312,7 +312,7 @@ sub readfile($) # enter the spot for dup checking and return true if it is already a dup sub dup { - my ($freq, $call, $d, $text) = @_; + my ($freq, $call, $d, $text, $by) = @_; # dump if too old return 2 if $d < $main::systime - $dupage; @@ -331,11 +331,14 @@ sub dup $text =~ s/[^a-zA-Z0-9]//g; for (-60, -120, -180, -240, 0, 60, 120, 180, 240, 300) { my $dt = $d - $_; - my $dupkey = "X$freq|$call|$dt|\L$text"; - return 1 if DXDupe::find($dupkey); + my $ldupkey = "X$freq|$call|$dt|\L$text"; + my $sdupkey = "X$freq|$call|$dt|$by"; + return 1 if DXDupe::find($ldupkey) || DXDupe::find($sdupkey); } - my $dupkey = "X$freq|$call|$d|\L$text"; - DXDupe::add($dupkey, $main::systime+$dupage); + my $ldupkey = "X$freq|$call|$d|\L$text"; + my $sdupkey = "X$freq|$call|$d|$by"; + DXDupe::add($ldupkey, $main::systime+$dupage); + DXDupe::add($sdupkey, $main::systime+$dupage); return 0; } -- 2.43.0