From: Eric Wong Date: Tue, 25 Apr 2023 10:50:51 +0000 (+0000) Subject: mail_diff: show headers differences in WWW /$MSGID/d/ view X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4a87bb8552579f5414496a38bec3c3ee585c37c;p=thirdparty%2Fpublic-inbox.git mail_diff: show headers differences in WWW /$MSGID/d/ view 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 --- diff --git a/lib/PublicInbox/ContentDigestDbg.pm b/lib/PublicInbox/ContentDigestDbg.pm index 5de0ee8ac..1e60364fb 100644 --- a/lib/PublicInbox/ContentDigestDbg.pm +++ b/lib/PublicInbox/ContentDigestDbg.pm @@ -1,6 +1,5 @@ # Copyright (C) all contributors # License: AGPL-3.0+ -# only loaded in lei package PublicInbox::ContentDigestDbg; # cf. PublicInbox::ContentDigest use v5.12; use Data::Dumper; diff --git a/lib/PublicInbox/MailDiff.pm b/lib/PublicInbox/MailDiff.pm index d9733ed40..994c7851e 100644 --- a/lib/PublicInbox/MailDiff.pm +++ b/lib/PublicInbox/MailDiff.pm @@ -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);