]> dxcluster.org Git - spider.git/commitdiff
substr the subject in the dup check so that AK1A msg dups are not treated
authorminima <minima>
Fri, 12 Oct 2001 11:39:14 +0000 (11:39 +0000)
committerminima <minima>
Fri, 12 Oct 2001 11:39:14 +0000 (11:39 +0000)
as new

Changes
perl/DXMsg.pm

diff --git a/Changes b/Changes
index 001e9e1c981ddddd7d29eeb339a32c4b2316b1e4..0a515c1e3a07404df16526d986ae04fcdf37c635 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 12Oct01=======================================================================
 1. make del nnn delete messages again (fix system Aliases file)
+2. substr the subject so that the dup works for stuff coming back via AK1A
 09Oct01=======================================================================
 1. change Aliases to allow shutdown as a command again. If you have changed
 /spider/cmd/Aliases and you update from CVS you may find it better to remove
index 677888f850948c490c9be43ebbc34abd7e30e49c..04239f16b6777581ade86c2cb0f036f087d1f42b 100644 (file)
@@ -282,7 +282,7 @@ sub process
                                                # does an identical message already exist?
                                                my $m;
                                                for $m (@msg) {
-                                                       if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
+                                                       if (substr($ref->{subject},0,28) eq substr($m->{subject},0,28) && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
                                                                $ref->stop_msg($fromnode);
                                                                my $msgno = $m->{msgno};
                                                                dbg("duplicate message from $ref->{from} -> $ref->{to} to msg: $msgno") if isdbg('msg');
@@ -1325,7 +1325,18 @@ sub import_one
        } else {
                push @chunk, $ref;
        }
-                                 
+
+       # does an identical message already exist?
+       my $m;
+       for $m (@msg) {
+               if (substr($subject,0,28) eq substr($m->{subject},0,28) && $from eq $m->{from} && grep $m->{to} eq $_, @to) {
+                       my $msgno = $m->{msgno};
+                       dbg("duplicate message from $from -> $m->{to} to msg: $msgno") if isdbg('msg');
+                       Log('msg', "duplicate message from $from -> $m->{to} to msg: $msgno");
+                       return;
+               }
+       }
+
     # write all the messages away
        my $i;
        for ( $i = 0;  $i < @chunk; $i++) {