]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
www: mail_diff: fix optional address obfuscation
authorEric Wong <e@80x24.org>
Tue, 28 Nov 2023 17:36:59 +0000 (17:36 +0000)
committerEric Wong <e@80x24.org>
Wed, 29 Nov 2023 02:13:30 +0000 (02:13 +0000)
We need to load the proper package and fully-qualify the sub
call since we shouldn't load Hval in lei.  Some users use this
feature even if its broken, oh well :<

lib/PublicInbox/MailDiff.pm

index b1c12d6d81bc71b85b9e15cec16c28282a34b372..98284b23a59ed36fd72fef1a13d44b3807d5245f 100644 (file)
@@ -47,6 +47,8 @@ sub prep_a ($$) {
        dump_eml($self, "$self->{tmp}/a", $eml);
 }
 
+# WWW-specific stuff below (TODO: split out for non-lei)
+
 sub next_smsg ($) {
        my ($self) = @_;
        my $ctx = $self->{ctx};
@@ -62,9 +64,12 @@ sub next_smsg ($) {
 
 sub emit_msg_diff {
        my ($bref, $self) = @_; # bref is `git diff' output
+       require PublicInbox::Hval;
+
        # will be escaped to `&#8226;' in HTML
        $self->{ctx}->{ibx}->{obfuscate} and
-               obfuscate_addrs($self->{ctx}->{ibx}, $$bref, "\x{2022}");
+               PublicInbox::Hval::obfuscate_addrs($self->{ctx}->{ibx},
+                                               $$bref, "\x{2022}");
        print { $self->{ctx}->{zfh} } '</pre><hr><pre>' if $self->{nr} > 1;
        flush_diff($self->{ctx}, $bref);
        next_smsg($self);