]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
mail_diff: show headers differences in WWW /$MSGID/d/ view
authorEric Wong <e@80x24.org>
Tue, 25 Apr 2023 10:50:51 +0000 (10:50 +0000)
committerEric Wong <e@80x24.org>
Tue, 25 Apr 2023 20:51:34 +0000 (20:51 +0000)
Some messages only differ in the To/Cc headers because some
MTAs seem to normalize them.  I was getting confused when I
saw some /d/ endpoints with no visible differences

lib/PublicInbox/ContentDigestDbg.pm
lib/PublicInbox/MailDiff.pm

index 5de0ee8ac3eb58d403a3b1bcf24d9920b0e4e4e5..1e60364fbeb097f5a1b83a2b80aa0a6220031a8b 100644 (file)
@@ -1,6 +1,5 @@
 # Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-# only loaded in lei
 package PublicInbox::ContentDigestDbg; # cf. PublicInbox::ContentDigest
 use v5.12;
 use Data::Dumper;
index d9733ed40a482d5776a986d40bc03ad9c1120bf9..994c7851e81e3405dfbd0c8e8f66881b0f72a513 100644 (file)
@@ -7,6 +7,7 @@ use PublicInbox::ContentHash qw(content_digest);
 use PublicInbox::MsgIter qw(msg_part_text);
 use PublicInbox::ViewDiff qw(flush_diff);
 use PublicInbox::GitAsyncCat;
+use PublicInbox::ContentDigestDbg;
 
 sub write_part { # Eml->each_part callback
        my ($ary, $self) = @_;
@@ -33,11 +34,6 @@ sub dump_eml ($$$) {
        local $self->{curdir} = $dir;
        mkdir $dir or die "mkdir($dir): $!";
        $eml->each_part(\&write_part, $self);
-
-       return if $self->{ctx}; # don't need content_digest noise in WWW UI
-       require PublicInbox::ContentDigestDbg;
-
-       # XXX is this even useful?  perhaps hide it behind a CLI switch
        open my $fh, '>', "$dir/content_digest" or die "open: $!";
        my $dig = PublicInbox::ContentDigestDbg->new($fh);
        content_digest($eml, $dig);