From: Eric Wong Date: Tue, 28 Nov 2023 17:36:59 +0000 (+0000) Subject: www: mail_diff: fix optional address obfuscation X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aaa1b18a14ab69a3dbd272ee9b20eef350310ae;p=thirdparty%2Fpublic-inbox.git www: mail_diff: fix optional address obfuscation 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 :< --- diff --git a/lib/PublicInbox/MailDiff.pm b/lib/PublicInbox/MailDiff.pm index b1c12d6d8..98284b23a 100644 --- a/lib/PublicInbox/MailDiff.pm +++ b/lib/PublicInbox/MailDiff.pm @@ -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 `•' 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} } '
' if $self->{nr} > 1;
 	flush_diff($self->{ctx}, $bref);
 	next_smsg($self);