fix dupes caused by AR-C adding prefix as last characters in the comment.
[spider.git] / perl / Spot.pm
index f331d105b540ae1cd2e4b414c631ffcfbf97eca4..95b7e902d8db2cf6f8f3aa9d5f455eed803674ea 100644 (file)
@@ -209,6 +209,9 @@ sub search
                           my \@a = (Prefix::cty_data(\$s[1]))[1..3];
                           my \@b = (Prefix::cty_data(\$s[4]))[1..3];
                           push \@s, \@a[0,1], \@b[0,1], \$a[2], \$a[2];  
+                      } else {
+                          \$s[12] ||= ' ';
+                          \$s[13] ||= ' ';
                       }
                          my (\$filter, \$hops) = \$dxchan->{spotsfilter}->it(\@s);
                          next unless (\$filter);
@@ -343,23 +346,21 @@ sub dup
                        $text = "" if $cty == $try[0];
                }
        }
+       $text = substr($text, 0, $duplth) if length $text > $duplth; 
+       $text =~ s/\s+$//;
        my $otext = $text;
        $text = pack("C*", map {$_ & 127} unpack("C*", $text));
        $text =~ s/[^\w]//g;
-       $text = substr($text, 0, $duplth) if length $text > $duplth; 
        my $ldupkey = "X$freq|$call|$by|$text";
        my $t = DXDupe::find($ldupkey);
        return 1 if $t && $t - $main::systime > 0;
        DXDupe::add($ldupkey, $main::systime+$dupage);
-       $otext = substr($otext, 0, $duplth) if length $otext > $duplth; 
-       $ldupkey = "X$freq|$call|$by|$otext";
-       $t = DXDupe::find($ldupkey);
-       return 1 if $t && $t - $main::systime > 0;
-       DXDupe::add($ldupkey, $main::systime+$dupage);
-#      my $sdupkey = "X$freq|$call|$by";
-#      $t = DXDupe::find($sdupkey);
-#      return 1 if $t && $t - $main::systime > 0;      
-#      DXDupe::add($sdupkey, $main::systime+$dupage);
+       if (length $otext && $otext ne $text) {
+               $ldupkey = "X$freq|$call|$by|$otext";
+               $t = DXDupe::find($ldupkey);
+               return 1 if $t && $t - $main::systime > 0;
+               DXDupe::add($ldupkey, $main::systime+$dupage);
+       }
        return 0;
 }