]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-05-15 22:40:31 by cjwatson]
authorcjwatson <>
Fri, 16 May 2003 05:40:31 +0000 (21:40 -0800)
committercjwatson <>
Fri, 16 May 2003 05:40:31 +0000 (21:40 -0800)
If there are multiple messages with the same message-id (e.g. sent to nnn@
and nnn-submitter@), consider all but the first as boring.

cgi/bugreport.cgi

index 8f55221c136e7c92f016e86c47212e8881cd2db5..897f9d939c76799c6f3253152dc3ff7d4cad6d87 100755 (executable)
@@ -148,6 +148,8 @@ my $log='';
 
 my $xmessage = 1;
 my $suppressnext = 0;
+my $found_msgid = 0;
+my %seen_msgid = ();
 
 my $thisheader = '';
 my $this = '';
@@ -276,6 +278,7 @@ while(my $line = <L>) {
                        $xmessage++ if ($normstate ne 'html');
 
                        $suppressnext = $normstate eq 'html';
+                       $found_msgid = 0;
                }
                
                $normstate = $newstate;
@@ -298,6 +301,16 @@ while(my $line = <L>) {
                $this .= $_;
        } elsif ($normstate eq 'go') {
                s/^\030//;
+               if (!$suppressnext && !$found_msgid &&
+                   /^Message-ID: <(.*)>/i) {
+                       my $msgid = $1;
+                       $found_msgid = 1;
+                       if ($seen_msgid{$msgid}) {
+                               $suppressnext = 1;
+                       } else {
+                               $seen_msgid{$msgid} = 1;
+                       }
+               }
                if (@mail) {
                        push @mail, $_;
                } else {
@@ -305,6 +318,16 @@ while(my $line = <L>) {
                }
        } elsif ($normstate eq 'go-nox') {
                next if !s/^X//;
+               if (!$suppressnext && !$found_msgid &&
+                   /^Message-ID: <(.*)>/i) {
+                       my $msgid = $1;
+                       $found_msgid = 1;
+                       if ($seen_msgid{$msgid}) {
+                               $suppressnext = 1;
+                       } else {
+                               $seen_msgid{$msgid} = 1;
+                       }
+               }
                if (@mail) {
                        push @mail, $_;
                } else {