From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/4] www: mail_diff: fix optional address obfuscation
Date: Tue, 28 Nov 2023 17:36:59 +0000 [thread overview]
Message-ID: <20231128173701.1472101-3-e@80x24.org> (raw)
In-Reply-To: <20231128173701.1472101-1-e@80x24.org>
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 | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/MailDiff.pm b/lib/PublicInbox/MailDiff.pm
index b1c12d6d..98284b23 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} } '</pre><hr><pre>' if $self->{nr} > 1;
flush_diff($self->{ctx}, $bref);
next_smsg($self);
next prev parent reply other threads:[~2023-11-28 17:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-28 17:36 [PATCH 0/4] non-cindex-related stuff Eric Wong
2023-11-28 17:36 ` [PATCH 1/4] lei q: fix --no-import-before completion + docs Eric Wong
2023-11-28 17:36 ` Eric Wong [this message]
2023-11-28 17:37 ` [PATCH 3/4] www: mail_diff: add final newline before diffing Eric Wong
2023-11-28 17:37 ` [PATCH 4/4] www: mail_diff: add missing </pre> tag Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231128173701.1472101-3-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).